class O2GMessageTableRow

Parents
O2GMessageRow

Brief

The class provides access to the message information.

Details

The class represents a single row of the Messages table.

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.
After tables are loaded, you must obtain an instance of the O2GMessagesTable class. For example,

O2GMessagesTable messagesTable = (O2GMessagesTable)tableManager.getTable(O2GTableType.MESSAGES);

Instantiating the class

If you need access to the current message information, you can get an instance of the class by calling any of the following methods of the O2GMessagesTable class:

O2GMessagesTable method

Syntax example

getRow

O2GMessageTableRow message = messagesTable.getRow(i);

findRow

O2GMessageTableRow message = messagesTable.findRow(mTradeID);

getNextRow

O2GMessageTableRow message = messagesTable.getNextRow(mIterator);

getNextRowByColumnValue

O2GMessageTableRow message = messagesTable.getNextRowByColumnValue("OfferID", mOfferID, mIterator);

getNextRowByColumnValues

O2GMessageTableRow message = messagesTable.getNextRowByColumnValues("Type", new Object[] { "1", "2" }, mIterator);

getNextRowByMultiColumnValues

O2GMessageTableRow message = messagesTable.getNextRowByMultiColumnValues(new String[] { "Feature", "From" }, new Object[] { mFeature, mFrom }, mIterator);

If you want to track incoming messages, your application must have a listener class that implements the IO2GTableListener interface. An instance of the listener class must be subscribed to the table update with the O2GTableUpdateType.INSERT type. Before the logout, you must unsubscribe the listener from this update type. The examples of subscription/unsubscription syntax are listed below.

IO2GTableListener method

Subscribe syntax

Unsubscribe syntax

onAdded

messagesTable.subscribeUpdate(O2GTableUpdateType.INSERT, tableListener);

messagesTable.unsubscribeUpdate(O2GTableUpdateType.INSERT, tableListener);

To instantiate the O2MessageTableRow class, you must cast the rowData parameter of the onAdded method above to the O2GMessageTableRow type. For example,

O2MessageTableRow row = (O2GMessageTableRow)(rowData);

Example

Get message sender and text [show]

The namespace is com.fxcore2.

Public Methods

getCell

Gets a cell of the table.

getColumns

Gets the columns of the table.

getFeature

Gets the type of the message content.

getFrom

Gets the login of the message sender.

getHTMLFragmentFlag

Gets the flag indicating whether the message is in the HTML format or not.

getMsgID

Gets the unique identification number of the message.

getSubject

Gets the subject of the message.

getTableType

Gets the type of the table.

getText

Gets a text body of the message.

getTime

Gets the date and time when the recipient receives the message.

getType

Gets the message container.

isCellChanged

Gets a flag indicating whether the value of the cell is changed.

back