com.devexperts.qd
Interface QDTicker

All Superinterfaces:
QDCollector, QDStatsContainer, SubscriptionContainer
All Known Implementing Classes:
LoggedTicker

public interface QDTicker
extends QDCollector

The QDTicker represents a ticker-view of the data. In the ticker-view, only last data values are important and data events are generated only to bring data snapshot up-to-date. Such contract also allows QDTicker to provide random access to current data values.


Method Summary
 boolean examineData(DataVisitor visitor)
          Examines all stored data via specified data visitor.
 void getData(RecordCursor.Owner owner, DataRecord record, int cipher, java.lang.String symbol)
          Gets all data for the specified record, cipher, and symbol in a single call and sets RecordCursor via caller-provided RecordCursor.Owner to the corresponding memory storage in read-only mode.
 void getData(RecordCursor cursor, DataRecord record, int cipher, java.lang.String symbol)
          Deprecated. Use getData(RecordCursor.Owner, DataRecord, int, String)
 int getInt(DataIntField field, int cipher, java.lang.String symbol)
          Returns current value of specified Int-field.
 java.lang.Object getObj(DataObjField field, int cipher, java.lang.String symbol)
          Returns current value of specified Obj-field.
 boolean isAvailable(DataRecord record, int cipher, java.lang.String symbol)
          Determines if value of specified record is available.
 boolean isStoreEverything()
          Returns status of "store everything" mode.
 void remove(RecordSource source)
          Removes the corresponding records from the underlying ticker storage.
 void setStoreEverything(boolean store_everything)
          Sets "store everything" mode (disabled by default).
 void setStoreEverythingFilter(SubscriptionFilter filter)
          Sets filter that is used for "store everything" mode.
 
Methods inherited from interface com.devexperts.qd.QDCollector
createAgent, createAgent, createDistributor, createDistributor, getContract, getScheme, getSymbol, setErrorHandler
 
Methods inherited from interface com.devexperts.qd.SubscriptionContainer
examineSubscription, getSubscriptionSize, isSubscribed
 
Methods inherited from interface com.devexperts.qd.stats.QDStatsContainer
getStats
 

Method Detail

isStoreEverything

boolean isStoreEverything()
Returns status of "store everything" mode.

See Also:
setStoreEverything(boolean)

setStoreEverything

void setStoreEverything(boolean store_everything)
Sets "store everything" mode (disabled by default). In this mode processData stores everything into underlying storage regardless of subscription (by default only records that are subscribed on are being stored). When subscription is removed records are not removed from storage (by default they are). Only records that match specified filter are subject to this mode (all records by default).


setStoreEverythingFilter

void setStoreEverythingFilter(SubscriptionFilter filter)
Sets filter that is used for "store everything" mode. Use null (default) to turn off filtering and store all records when "store everything" mode is on.

See Also:
setStoreEverything(boolean)

isAvailable

boolean isAvailable(DataRecord record,
                    int cipher,
                    java.lang.String symbol)
Determines if value of specified record is available.


getInt

int getInt(DataIntField field,
           int cipher,
           java.lang.String symbol)
Returns current value of specified Int-field. Returns 0 if such value does not exist or is unknown.


getObj

java.lang.Object getObj(DataObjField field,
                        int cipher,
                        java.lang.String symbol)
Returns current value of specified Obj-field. Returns null if such value does not exist or is unknown.


getData

void getData(RecordCursor cursor,
             DataRecord record,
             int cipher,
             java.lang.String symbol)
Deprecated. Use getData(RecordCursor.Owner, DataRecord, int, String)

Gets all data for the specified record, cipher, and symbol in a single call and returns it via caller-provided RecordCursor.


getData

void getData(RecordCursor.Owner owner,
             DataRecord record,
             int cipher,
             java.lang.String symbol)
Gets all data for the specified record, cipher, and symbol in a single call and sets RecordCursor via caller-provided RecordCursor.Owner to the corresponding memory storage in read-only mode. This way, any fields can be retried from ticker without requiring any actual data copy or memory allocation.


examineData

boolean examineData(DataVisitor visitor)
Examines all stored data via specified data visitor. Returns true if some data was not examined or false if everything was examined.


remove

void remove(RecordSource source)
Removes the corresponding records from the underlying ticker storage. Removal is performed under global lock on the ticker storage and only for records whose contents exactly (identity-wise) match the given source. Unless the record arrives again, isAvailable(com.devexperts.qd.DataRecord, int, java.lang.String) will become false for all removed records.

This method is designed to facilitate cleanup of stale data. Intended pattern for this method is to call examineData(com.devexperts.qd.DataVisitor), store stale records to be removed into RecordBuffer and use remove(com.devexperts.qd.ng.RecordSource) for them.