class O2GOffersTableResponseReader

Parents
O2GGenericTableResponseReader

Brief

The class reads a stream of offer rows coming from the trading server.

Details

All data from the trading server come in the form of responses. The type of the response depends on the type of the request. An O2GResponse object of the GetOffers type comes from the trading server as a response to a request for the initial offer information. The response consists of the Offers table rows. Every row is represented by an O2GOfferRow object. In order to read this response you must use the O2GOffersTableResponseReader.

Getting the response

If your application uses the O2GTableManager, the Offers table is always loaded during the login process. This information is kept in an O2GOffersTable object.

If your application does not use the O2GTableManager, the initial offer information needs to be requested.
Depending on the trading server settings, the Offers table may or may not be loaded by the server automatically during the login process. To determine whether the table is loaded or not and what follow-up action is required to obtain the GetOffers response, use the returned value of the O2GLoginRules.isTableLoadedByDefault method with the O2GTableType.Offers argument:

Returned Value

Follow-up action

true

Call the O2GLoginRules.getTableRefreshResponse method. For example,

O2GResponse offersResponse = loginRules.getTableRefreshResponse(O2GTableType.Offers);

false

Create a request to get initial offer information by using the O2GRequestFactory.createRefreshTableRequest method. For example,

O2GRequest request = requestFactory.createRefreshTableRequest(O2GTableType.Offers);

In this case, an instance of the O2GResponse class is the response parameter in your implementation of the IO2GResponseListener.onRequestCompleted method.

Instantiating the class

After receiving the GetOffers response, an instance of the O2GOffersTableResponseReader class can be obtained by calling the O2GResponseReaderFactory.createOffersTableReader method. For example:

O2GResponseReaderFactory responseFactory = session.getResponseReaderFactory();
O2GOffersTableResponseReader offersReader = responseFactory.createOffersTableReader(offersResponse);

The type defined in the fxcore2.dll assembly. The namespace is fxcore2.

Public Properties

Columns

Gets an instance of the class that provides access to the list of table columns.

Count

Gets the number of rows in the reader.

Type

Gets the type of a trading table.

Public Methods

getCell

Gets the value of a cell.

getGenericRow

Gets a generic row by its index.

getRow

Gets a row from the Offers table.

isCellValid

Checks whether the cell value can be used or not.

back