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 void
add(deltix.qsrv.hf.pub.InstrumentIdentity[] ids, java.lang.String[] types)
Add the specified entities and types to subscription.void
addEntities(deltix.qsrv.hf.pub.InstrumentIdentity[] ids, int offset, int length)
Bulk add the specified entities to subscription.void
addEntity(deltix.qsrv.hf.pub.InstrumentIdentity id)
Add the specified entity to subscription.void
addStream(TickStream... tickStreams)
Add streams to subscription.void
addTypes(java.lang.String... names)
Add the specified type names to subscription.void
clearAllEntities()
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.boolean
hasSubscribedTypes()
Indicates true if types subscription is not empty.boolean
isAllEntitiesSubscribed()
Indicates that all entities subscribed (no filtering).boolean
isAllTypesSubscribed()
Indicates that all types subscribed (no filtering).void
remove(deltix.qsrv.hf.pub.InstrumentIdentity[] ids, java.lang.String[] types)
Remove the specified entities and types from subscription.void
removeAllStreams()
Remove all streams from subscription.void
removeEntities(deltix.qsrv.hf.pub.InstrumentIdentity[] ids, int offset, int length)
Remove the specified entities from subscription.void
removeEntity(deltix.qsrv.hf.pub.InstrumentIdentity id)
Remove the specified entity from subscription.void
removeStream(TickStream... tickStreams)
Remove streams from subscription.void
removeTypes(java.lang.String... names)
Remove the specified types from subscription.void
reset(long time)
Reposition the message source to a new point in time, while preserving current subscription.void
setTimeForNewSubscriptions(long time)
This method affects subsequent "add subscription" methods, such as, for instance, addEntity ().void
setTypes(java.lang.String... names)
Subscribe to specified types.void
subscribeToAllEntities()
Subscribe to all available entities.void
subscribeToAllTypes()
Subscribe to all available types (no filtering).static InstrumentMessageSource
wrap(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:SubscriptionInfo
Get the specified entities of the current subscription.- Specified by:
getSubscribedEntities
in interfaceSubscriptionInfo
- Returns:
- not-nullable array of subscribed entities.
-
isAllEntitiesSubscribed
public boolean isAllEntitiesSubscribed()
Description copied from interface:SubscriptionInfo
Indicates that all entities subscribed (no filtering).- Specified by:
isAllEntitiesSubscribed
in interfaceSubscriptionInfo
- Returns:
- true if all entities subscribed.
-
getSubscribedTypes
public java.lang.String[] getSubscribedTypes()
Description copied from interface:SubscriptionInfo
Get the specified type names of the current subscription.- Specified by:
getSubscribedTypes
in interfaceSubscriptionInfo
- Returns:
- not-nullable array of subscribed type names.
-
isAllTypesSubscribed
public boolean isAllTypesSubscribed()
Description copied from interface:SubscriptionInfo
Indicates that all types subscribed (no filtering).- Specified by:
isAllTypesSubscribed
in interfaceSubscriptionInfo
- Returns:
- true if all types subscribed.
-
hasSubscribedTypes
public boolean hasSubscribedTypes()
Description copied from interface:SubscriptionInfo
Indicates true if types subscription is not empty.- Specified by:
hasSubscribedTypes
in interfaceSubscriptionInfo
- Returns:
- true if at least one type was subscribed.
-
subscribeToAllEntities
public void subscribeToAllEntities()
Description copied from interface:EntitySubscriptionController
Subscribe to all available entities.- Specified by:
subscribeToAllEntities
in interfaceEntitySubscriptionController
- Overrides:
subscribeToAllEntities
in classInstrumentMessageSourceAdapter
-
clearAllEntities
public void clearAllEntities()
Description copied from interface:EntitySubscriptionController
Switch to selective subscription mode (if necessary) and clear the list.- Specified by:
clearAllEntities
in interfaceEntitySubscriptionController
- Overrides:
clearAllEntities
in classInstrumentMessageSourceAdapter
-
add
public void add(deltix.qsrv.hf.pub.InstrumentIdentity[] ids, java.lang.String[] types)
Description copied from interface:EntityAndTypeSubscriptionController
Add 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:
add
in interfaceEntityAndTypeSubscriptionController
- Overrides:
add
in 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:EntityAndTypeSubscriptionController
Remove 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:
remove
in interfaceEntityAndTypeSubscriptionController
- Overrides:
remove
in 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:EntitySubscriptionController
Add 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:
addEntity
in interfaceEntitySubscriptionController
- Overrides:
addEntity
in classInstrumentMessageSourceAdapter
-
addEntities
public void addEntities(deltix.qsrv.hf.pub.InstrumentIdentity[] ids, int offset, int length)
Description copied from interface:EntitySubscriptionController
Bulk 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:
addEntities
in interfaceEntitySubscriptionController
- Overrides:
addEntities
in classInstrumentMessageSourceAdapter
-
removeEntity
public void removeEntity(deltix.qsrv.hf.pub.InstrumentIdentity id)
Description copied from interface:EntitySubscriptionController
Remove 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:
removeEntity
in interfaceEntitySubscriptionController
- Overrides:
removeEntity
in classInstrumentMessageSourceAdapter
-
removeEntities
public void removeEntities(deltix.qsrv.hf.pub.InstrumentIdentity[] ids, int offset, int length)
Description copied from interface:EntitySubscriptionController
Remove 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:
removeEntities
in interfaceEntitySubscriptionController
- Overrides:
removeEntities
in classInstrumentMessageSourceAdapter
-
addStream
public void addStream(TickStream... tickStreams)
Description copied from interface:StreamSubscriptionController
Add streams to subscription. Current time and filter is used to query data from new sources.- Specified by:
addStream
in interfaceStreamSubscriptionController
- Overrides:
addStream
in classInstrumentMessageSourceAdapter
- Parameters:
tickStreams
- Streams to add.
-
removeAllStreams
public void removeAllStreams()
Description copied from interface:StreamSubscriptionController
Remove all streams from subscription.- Specified by:
removeAllStreams
in interfaceStreamSubscriptionController
- Overrides:
removeAllStreams
in classInstrumentMessageSourceAdapter
-
removeStream
public void removeStream(TickStream... tickStreams)
Description copied from interface:StreamSubscriptionController
Remove streams from subscription.- Specified by:
removeStream
in interfaceStreamSubscriptionController
- Overrides:
removeStream
in classInstrumentMessageSourceAdapter
- Parameters:
tickStreams
- Streams to remove.
-
setTimeForNewSubscriptions
public void setTimeForNewSubscriptions(long time)
Description copied from interface:TimeController
This method affects subsequent "add subscription" methods, such as, for instance, addEntity (). New subscriptions start at the specified time.- Specified by:
setTimeForNewSubscriptions
in interfaceTimeController
- Overrides:
setTimeForNewSubscriptions
in classInstrumentMessageSourceAdapter
- Parameters:
time
- The time to use, orTimeConstants.USE_CURRENT_TIME
to use server's system time, orTimeConstants.USE_CURSOR_TIME
to use cursor's last read time.
-
reset
public void reset(long time)
Description copied from interface:TimeController
Reposition the message source to a new point in time, while preserving current subscription.- Specified by:
reset
in interfaceTimeController
- Overrides:
reset
in classInstrumentMessageSourceAdapter
- Parameters:
time
- The new position in time.
-
subscribeToAllTypes
public void subscribeToAllTypes()
Description copied from interface:TypeSubscriptionController
Subscribe to all available types (no filtering).- Specified by:
subscribeToAllTypes
in interfaceTypeSubscriptionController
- Overrides:
subscribeToAllTypes
in classInstrumentMessageSourceAdapter
-
setTypes
public void setTypes(java.lang.String... names)
Description copied from interface:TypeSubscriptionController
Subscribe to specified types.- Specified by:
setTypes
in interfaceTypeSubscriptionController
- Overrides:
setTypes
in classInstrumentMessageSourceAdapter
-
addTypes
public void addTypes(java.lang.String... names)
Description copied from interface:TypeSubscriptionController
Add the specified type names to subscription.- Specified by:
addTypes
in interfaceTypeSubscriptionController
- Overrides:
addTypes
in classInstrumentMessageSourceAdapter
-
removeTypes
public void removeTypes(java.lang.String... names)
Description copied from interface:TypeSubscriptionController
Remove the specified types from subscription.- Specified by:
removeTypes
in interfaceTypeSubscriptionController
- Overrides:
removeTypes
in classInstrumentMessageSourceAdapter
-
-