Class SelectedAccountChangedMessage

java.lang.Object
velox.api.layer1.messages.SelectedAccountChangedMessage
All Implemented Interfaces:
velox.api.layer1.messages.ChangeAccountsMessage

public class SelectedAccountChangedMessage extends Object implements velox.api.layer1.messages.ChangeAccountsMessage
Message that is sent via Layer1ApiAdminListener.onUserMessage(Object), when the user changes the selected trading account in the GUI on TCP (Trading Control Panel).
  • Field Details

    • alias

      public final String alias
      Alias of the instrument for which the account is selected. Cannot be null.
    • accountId

      public final String accountId
      Account id of the selected account. If null - no account is selected for the instrument.
    • messageId

      public final String messageId
      Unique id of this message.

      Must be unique for each SelectedAccountChangedMessage. It can be used to correlate this message with the original one if alias or accountId were remapped (e.g. by an add-on).

      If an add-on remaps the message by creating a new instance, it should copy this id to the remapped message.

      Example (cross-trading):

      • In sendUserMessage: map the host instrument alias to the target alias and store messageId -> originalHostAlias.
      • In onUserMessage: if messageId is present in the map, replace the alias back to the original host alias and remove the entry.
  • Constructor Details

    • SelectedAccountChangedMessage

      public SelectedAccountChangedMessage(String alias, String accountId)
    • SelectedAccountChangedMessage

      public SelectedAccountChangedMessage(String messageId, String alias, String accountId)
  • Method Details

    • getAlias

      public String getAlias()
      Specified by:
      getAlias in interface velox.api.layer1.messages.ChangeAccountsMessage
    • toString

      public String toString()
      Overrides:
      toString in class Object