class O2GMessagesTable
Parents | |
|
Brief
The class keeps in memory the up-to-date information about dealing desk messages received during the current trading day.
Details
The class is an in-memory representation of the Messages table.
In order to keep this representation
in sync with the trading server, you must instantiate the class and listen to the updates coming from the trading server.
The class provides methods to find individual messages, represented by the O2GMessageTableRow
.
Prerequisites
The class is available only through the use of the O2GTableManager
. An O2GTableManager
object must have the O2GTableManagerStatus.TABLES_LOADED status.
For complete instructions on the table manager usage, see the
How to use table manager in ForexConnect API section.
Instantiating the class
In order to get messages information for the first time, you must obtain an instance of the class by calling the
O2GTableManager
.getTable
method with the
O2GTableType.MESSAGES
argument. For example,
O2GMessagesTable messagesTable = (O2GMessagesTable)tableManager.getTable(O2GTableType.MESSAGES);
Receiving notifications about the Messages table updates
In order to keep the O2GMessagesTable
data current, your application must listen to the new messages coming from the trading server.
An instance of the class implementing the IO2GTableListener
interface
must be subscribed to the table update of the O2GTableUpdateType.INSERT type.
Before the logout, you must unsubscribe the listener from this update type.
The table below shows the subscription/unsubsription syntax for the O2GMessagesTable
:
Update type |
Subscribe syntax |
Unsubscribe syntax |
INSERT |
|
|
Note: Messages are not changed or deleted during the trading session. Therefore, you
do not receive updates of the UPDATE
or DELETE
types during the trading session and there is no need to subscribe to them.
Example
Get message sender and text [show]
The namespace is com.fxcore2
.
Public Methods | |
Finds a row in the |
|
Iterates through the rows of a table. |
|
Gets the next row from a table. |
|
Gets the next row from |
|
Gets the next row from |
|
Gets the next row from |
|
Gets the next row from the |
|
Gets the next row from |
|
Gets the next row from |
|
Gets the next row from |
|
Gets a row from the |
|
Gets the status of a table. |
|
Checks whether the value of a cell has changed on not. |
|
Subscribes a table listener to table status changes. |
|
Subscribes a table listener to table updates. |
|
Unsubscribes a table listener from table status changes. |
|
Unsubscribes a table listener from table updates. |