Class SelectAccountMessage

java.lang.Object
velox.api.layer1.messages.SelectAccountMessage

public class SelectAccountMessage extends Object
This message requests account selection. Should be sent via Layer1ApiAdminListener.onUserMessage(Object)
  • Field Summary

    Fields
    Modifier and Type
    Field
    Description
    final AccountInfo[]
    Array of accounts to select from
  • Constructor Summary

    Constructors
    Constructor
    Description
    Constructs new account selection request
  • Method Summary

    Modifier and Type
    Method
    Description
    int
    get()
    Waits till selection is done and returns index of account that was selected.
    void
    set(int selectedIndex)
    Sets selected account index after selection is performed.

    Methods inherited from class java.lang.Object

    clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
  • Field Details

    • accountsInfo

      public final AccountInfo[] accountsInfo
      Array of accounts to select from
  • Constructor Details

    • SelectAccountMessage

      public SelectAccountMessage(AccountInfo[] accountsInfo)
      Constructs new account selection request
      Parameters:
      accountsInfo - accounts to select from
  • Method Details

    • set

      public void set(int selectedIndex)
      Sets selected account index after selection is performed. Should be called once. This unblocks all pending get() calls and prevents blocking further ones.
      Parameters:
      selectedIndex - index in accountsInfo array
    • get

      public int get() throws InterruptedException
      Waits till selection is done and returns index of account that was selected. Can be called from multiple places.
      Returns:
      index of selected account in array passed to SelectAccountMessage(AccountInfo[]) and available as accountsInfo
      Throws:
      InterruptedException - if the current thread is interrupted while waiting