Package deltix.qsrv.hf.tickdb.pub
Class SubscriptionManagerWrapper
- java.lang.Object
-
- deltix.qsrv.hf.tickdb.pub.MessageSourceAdapter<deltix.qsrv.hf.pub.InstrumentMessage>
-
- deltix.qsrv.hf.tickdb.pub.InstrumentMessageSourceAdapter
-
- deltix.qsrv.hf.tickdb.pub.SubscriptionManagerWrapper
-
- All Implemented Interfaces:
deltix.data.stream.MessageSource<deltix.qsrv.hf.pub.InstrumentMessage>,RealTimeMessageSource<deltix.qsrv.hf.pub.InstrumentMessage>,EntityAndTypeSubscriptionController,EntitySubscriptionController,InstrumentMessageSource,MessageInfo,StreamSubscriptionController,SubscriptionController,SubscriptionInfo,SubscriptionManager,SymbolAndTypeSubscriptionController,SymbolSubscriptionController,TimeController,TypedMessageSource,TypeSubscriptionController,deltix.util.concurrent.AbstractCursor,deltix.util.concurrent.IntermittentlyAvailableResource,deltix.util.lang.Disposable,java.io.Closeable,java.lang.AutoCloseable
public class SubscriptionManagerWrapper extends InstrumentMessageSourceAdapter implements SubscriptionManager
Provides SubscriptionManager capabilities to InstrumentMessageSource
-
-
Method Summary
All Methods Static Methods Instance Methods Concrete Methods Modifier and Type Method Description voidadd(deltix.qsrv.hf.pub.InstrumentIdentity[] ids, java.lang.String[] types)Add the specified entities and types to subscription.voidaddEntities(deltix.qsrv.hf.pub.InstrumentIdentity[] ids, int offset, int length)Bulk add the specified entities to subscription.voidaddEntity(deltix.qsrv.hf.pub.InstrumentIdentity id)Add the specified entity to subscription.voidaddStream(TickStream... tickStreams)Add streams to subscription.voidaddTypes(java.lang.String... names)Add the specified type names to subscription.voidclearAllEntities()Switch to selective subscription mode (if necessary) and clear the list.deltix.qsrv.hf.pub.InstrumentIdentity[]getSubscribedEntities()Get the specified entities of the current subscription.java.lang.String[]getSubscribedTypes()Get the specified type names of the current subscription.booleanhasSubscribedTypes()Indicates true if types subscription is not empty.booleanisAllEntitiesSubscribed()Indicates that all entities subscribed (no filtering).booleanisAllTypesSubscribed()Indicates that all types subscribed (no filtering).voidremove(deltix.qsrv.hf.pub.InstrumentIdentity[] ids, java.lang.String[] types)Remove the specified entities and types from subscription.voidremoveAllStreams()Remove all streams from subscription.voidremoveEntities(deltix.qsrv.hf.pub.InstrumentIdentity[] ids, int offset, int length)Remove the specified entities from subscription.voidremoveEntity(deltix.qsrv.hf.pub.InstrumentIdentity id)Remove the specified entity from subscription.voidremoveStream(TickStream... tickStreams)Remove streams from subscription.voidremoveTypes(java.lang.String... names)Remove the specified types from subscription.voidreset(long time)Reposition the message source to a new point in time, while preserving current subscription.voidsetTimeForNewSubscriptions(long time)This method affects subsequent "add subscription" methods, such as, for instance, addEntity ().voidsetTypes(java.lang.String... names)Subscribe to specified types.voidsubscribeToAllEntities()Subscribe to all available entities.voidsubscribeToAllTypes()Subscribe to all available types (no filtering).static InstrumentMessageSourcewrap(InstrumentMessageSource source)-
Methods inherited from class deltix.qsrv.hf.tickdb.pub.InstrumentMessageSourceAdapter
add, addSymbol, addSymbols, addSymbols, clearAllSymbols, close, getCurrentEntityIndex, getCurrentStream, getCurrentStreamIndex, getCurrentStreamKey, getCurrentType, getCurrentTypeIndex, getDelegate, getMessage, isAtEnd, isClosed, isRealTime, next, realTimeAvailable, remove, removeSymbol, removeSymbols, removeSymbols, setAvailabilityListener, subscribeToAllSymbols
-
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
-
Methods inherited from interface deltix.qsrv.hf.tickdb.pub.query.EntitySubscriptionController
addEntities, removeEntities
-
Methods inherited from interface deltix.qsrv.hf.tickdb.pub.query.SubscriptionInfo
getSubscribedSymbols, isAllSymbolsSubscribed
-
-
-
-
Method Detail
-
wrap
public static InstrumentMessageSource wrap(InstrumentMessageSource source)
-
getSubscribedEntities
public deltix.qsrv.hf.pub.InstrumentIdentity[] getSubscribedEntities()
Description copied from interface:SubscriptionInfoGet the specified entities of the current subscription.- Specified by:
getSubscribedEntitiesin interfaceSubscriptionInfo- Returns:
- not-nullable array of subscribed entities.
-
isAllEntitiesSubscribed
public boolean isAllEntitiesSubscribed()
Description copied from interface:SubscriptionInfoIndicates that all entities subscribed (no filtering).- Specified by:
isAllEntitiesSubscribedin interfaceSubscriptionInfo- Returns:
- true if all entities subscribed.
-
getSubscribedTypes
public java.lang.String[] getSubscribedTypes()
Description copied from interface:SubscriptionInfoGet the specified type names of the current subscription.- Specified by:
getSubscribedTypesin interfaceSubscriptionInfo- Returns:
- not-nullable array of subscribed type names.
-
isAllTypesSubscribed
public boolean isAllTypesSubscribed()
Description copied from interface:SubscriptionInfoIndicates that all types subscribed (no filtering).- Specified by:
isAllTypesSubscribedin interfaceSubscriptionInfo- Returns:
- true if all types subscribed.
-
hasSubscribedTypes
public boolean hasSubscribedTypes()
Description copied from interface:SubscriptionInfoIndicates true if types subscription is not empty.- Specified by:
hasSubscribedTypesin interfaceSubscriptionInfo- Returns:
- true if at least one type was subscribed.
-
subscribeToAllEntities
public void subscribeToAllEntities()
Description copied from interface:EntitySubscriptionControllerSubscribe to all available entities.- Specified by:
subscribeToAllEntitiesin interfaceEntitySubscriptionController- Overrides:
subscribeToAllEntitiesin classInstrumentMessageSourceAdapter
-
clearAllEntities
public void clearAllEntities()
Description copied from interface:EntitySubscriptionControllerSwitch to selective subscription mode (if necessary) and clear the list.- Specified by:
clearAllEntitiesin interfaceEntitySubscriptionController- Overrides:
clearAllEntitiesin classInstrumentMessageSourceAdapter
-
add
public void add(deltix.qsrv.hf.pub.InstrumentIdentity[] ids, java.lang.String[] types)Description copied from interface:EntityAndTypeSubscriptionControllerAdd the specified entities and types to subscription. The type and symbol are copied from the incoming object, if necessary, so the argument can be re-used after the call.- Specified by:
addin interfaceEntityAndTypeSubscriptionController- Overrides:
addin classInstrumentMessageSourceAdapter- Parameters:
ids- not-null array of instruments to subscribe.types- not-null array of type names to subscribe.
-
remove
public void remove(deltix.qsrv.hf.pub.InstrumentIdentity[] ids, java.lang.String[] types)Description copied from interface:EntityAndTypeSubscriptionControllerRemove the specified entities and types from subscription. The type and symbol are copied from the incoming objects, if necessary, so the arguments can be re-used after the call.- Specified by:
removein interfaceEntityAndTypeSubscriptionController- Overrides:
removein classInstrumentMessageSourceAdapter- Parameters:
ids- not-null array of instruments to subscribe.types- not-null array of type names to subscribe.
-
addEntity
public void addEntity(deltix.qsrv.hf.pub.InstrumentIdentity id)
Description copied from interface:EntitySubscriptionControllerAdd the specified entity to subscription. The type and symbol are copied from the incoming object, if necessary, so the argument can be re-used after the call. Special note about options: The following fragment will subscribe to specific option contract "DAV 100417P00085000":addEntity(new InstrumentKey(InstrumentType.OPTION, "DAV 100417P00085000"));While the following will subscribe to option root (and you will get all instruments with this root):addEntity(new InstrumentKey(InstrumentType.OPTION, "DAV "));- Specified by:
addEntityin interfaceEntitySubscriptionController- Overrides:
addEntityin classInstrumentMessageSourceAdapter
-
addEntities
public void addEntities(deltix.qsrv.hf.pub.InstrumentIdentity[] ids, int offset, int length)Description copied from interface:EntitySubscriptionControllerBulk add the specified entities to subscription. The type and symbol are copied from the incoming objects, if necessary, so the arguments can be re-used after the call.- Specified by:
addEntitiesin interfaceEntitySubscriptionController- Overrides:
addEntitiesin classInstrumentMessageSourceAdapter
-
removeEntity
public void removeEntity(deltix.qsrv.hf.pub.InstrumentIdentity id)
Description copied from interface:EntitySubscriptionControllerRemove the specified entity from subscription. The type and symbol are copied from the incoming object, if necessary, so the argument can be re-used after the call.- Specified by:
removeEntityin interfaceEntitySubscriptionController- Overrides:
removeEntityin classInstrumentMessageSourceAdapter
-
removeEntities
public void removeEntities(deltix.qsrv.hf.pub.InstrumentIdentity[] ids, int offset, int length)Description copied from interface:EntitySubscriptionControllerRemove the specified entities from subscription. The type and symbol are copied from the incoming objects, if necessary, so the arguments can be re-used after the call.- Specified by:
removeEntitiesin interfaceEntitySubscriptionController- Overrides:
removeEntitiesin classInstrumentMessageSourceAdapter
-
addStream
public void addStream(TickStream... tickStreams)
Description copied from interface:StreamSubscriptionControllerAdd streams to subscription. Current time and filter is used to query data from new sources.- Specified by:
addStreamin interfaceStreamSubscriptionController- Overrides:
addStreamin classInstrumentMessageSourceAdapter- Parameters:
tickStreams- Streams to add.
-
removeAllStreams
public void removeAllStreams()
Description copied from interface:StreamSubscriptionControllerRemove all streams from subscription.- Specified by:
removeAllStreamsin interfaceStreamSubscriptionController- Overrides:
removeAllStreamsin classInstrumentMessageSourceAdapter
-
removeStream
public void removeStream(TickStream... tickStreams)
Description copied from interface:StreamSubscriptionControllerRemove streams from subscription.- Specified by:
removeStreamin interfaceStreamSubscriptionController- Overrides:
removeStreamin classInstrumentMessageSourceAdapter- Parameters:
tickStreams- Streams to remove.
-
setTimeForNewSubscriptions
public void setTimeForNewSubscriptions(long time)
Description copied from interface:TimeControllerThis method affects subsequent "add subscription" methods, such as, for instance, addEntity (). New subscriptions start at the specified time.- Specified by:
setTimeForNewSubscriptionsin interfaceTimeController- Overrides:
setTimeForNewSubscriptionsin classInstrumentMessageSourceAdapter- Parameters:
time- The time to use, orTimeConstants.USE_CURRENT_TIMEto use server's system time, orTimeConstants.USE_CURSOR_TIMEto use cursor's last read time.
-
reset
public void reset(long time)
Description copied from interface:TimeControllerReposition the message source to a new point in time, while preserving current subscription.- Specified by:
resetin interfaceTimeController- Overrides:
resetin classInstrumentMessageSourceAdapter- Parameters:
time- The new position in time.
-
subscribeToAllTypes
public void subscribeToAllTypes()
Description copied from interface:TypeSubscriptionControllerSubscribe to all available types (no filtering).- Specified by:
subscribeToAllTypesin interfaceTypeSubscriptionController- Overrides:
subscribeToAllTypesin classInstrumentMessageSourceAdapter
-
setTypes
public void setTypes(java.lang.String... names)
Description copied from interface:TypeSubscriptionControllerSubscribe to specified types.- Specified by:
setTypesin interfaceTypeSubscriptionController- Overrides:
setTypesin classInstrumentMessageSourceAdapter
-
addTypes
public void addTypes(java.lang.String... names)
Description copied from interface:TypeSubscriptionControllerAdd the specified type names to subscription.- Specified by:
addTypesin interfaceTypeSubscriptionController- Overrides:
addTypesin classInstrumentMessageSourceAdapter
-
removeTypes
public void removeTypes(java.lang.String... names)
Description copied from interface:TypeSubscriptionControllerRemove the specified types from subscription.- Specified by:
removeTypesin interfaceTypeSubscriptionController- Overrides:
removeTypesin classInstrumentMessageSourceAdapter
-
-