com.devexperts.qd
Interface SubscriptionContainer

All Known Subinterfaces:
QDAgent, QDCollector, QDHistory, QDStream, QDTicker
All Known Implementing Classes:
LoggedAgent, LoggedCollector, LoggedHistory, LoggedStream, LoggedTicker

public interface SubscriptionContainer

The SubscriptionContainer represents data structure that keeps subscription in map-like fashion. Methods to examine subscription in different granularity levels are provided.


Method Summary
 boolean examineSubscription(SubscriptionVisitor visitor)
          Examines subscription and passes it to the visitor.
 int getSubscriptionSize()
          Returns subscription size in terms of (record, symbol) pairs.
 boolean isSubscribed(DataRecord record, int cipher, java.lang.String symbol, long time)
          Returns true if subscribed to the corresponding record and symbol with the corresponding time.
 

Method Detail

isSubscribed

boolean isSubscribed(DataRecord record,
                     int cipher,
                     java.lang.String symbol,
                     long time)
Returns true if subscribed to the corresponding record and symbol with the corresponding time. Non-historic (stream and ticker) QD ignores time parameter.

Note: Check by time in history is not guaranteed yet (may transiently give wrong result), because it performs unsynchronized read on two ints to get time from internal data structure. In history it is guaranteed to work properly only when time parameter is set to Long.MAX_VALUE.


examineSubscription

boolean examineSubscription(SubscriptionVisitor visitor)
Examines subscription and passes it to the visitor. Returns true if not all subscription was examined or false otherwise.

Note: Visited subscription time in history is not guaranteed yet (may transiently give wrong result), because it performs unsynchronized read on two ints to get time from internal data structure.


getSubscriptionSize

int getSubscriptionSize()
Returns subscription size in terms of (record, symbol) pairs.