Package deltix.qsrv.hf.stream
Class MessageReader2
- java.lang.Object
-
- deltix.qsrv.hf.stream.AbstractMessageReader
-
- deltix.qsrv.hf.stream.MessageReader2
-
- All Implemented Interfaces:
deltix.data.stream.ConsumableMessageSource<deltix.qsrv.hf.pub.InstrumentMessage>,deltix.data.stream.MessageSource<deltix.qsrv.hf.pub.InstrumentMessage>,EntitySubscriptionController,TypedMessageSource,TypeSubscriptionController,deltix.util.concurrent.AbstractCursor,deltix.util.lang.Disposable,java.io.Closeable,java.lang.AutoCloseable
public class MessageReader2 extends AbstractMessageReader implements deltix.data.stream.ConsumableMessageSource<deltix.qsrv.hf.pub.InstrumentMessage>, TypeSubscriptionController, EntitySubscriptionController
-
-
Field Summary
Fields Modifier and Type Field Description protected deltix.qsrv.hf.pub.InstrumentKeycurrentEntityprotected deltix.util.time.Intervalperiodicity-
Fields inherited from class deltix.qsrv.hf.stream.AbstractMessageReader
buffer, bytes, curMsg, curTypeCode, decoders, ITYPE_TYPES, messages, rawMsg, symbol, types
-
-
Constructor Summary
Constructors Modifier Constructor Description MessageReader2(java.io.InputStream in, long inLength, boolean unzip, int bufferSize, TypeLoader bindLoader)protectedMessageReader2(java.io.InputStream in, long inLength, boolean unzip, int bufferSize, TypeLoader bindLoader, RecordClassDescriptor[] types)protectedMessageReader2(java.io.InputStream input, long inLength, RecordClassDescriptor[] types)
-
Method Summary
All Methods Static Methods Instance Methods Concrete Methods Modifier and Type Method Description 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.voidaddTypes(java.lang.String... names)Add the specified type names to subscription.voidclearAllEntities()Switch to selective subscription mode (if necessary) and clear the list.voidclose()static MessageReader2create(java.io.File f, int bufferSize, TypeLoader loader)static MessageReader2create(java.io.File f, RecordClassDescriptor[] types)static MessageReader2create(java.io.File f, TypeLoader loader)static MessageReader2createRaw(java.io.File f)doublegetProgress()booleanisAtEnd()static voidmain(java.lang.String[] args)booleannext()protected RecordClassDescriptor[]readHeader()static bytereadVersion(java.io.File f)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.voidremoveTypes(java.lang.String... names)Remove the specified types from subscription.voidsetTypes(java.lang.String... names)Subscribe to specified types.voidsubscribeToAllEntities()Subscribe to all available entities.voidsubscribeToAllTypes()Subscribe to all available types (no filtering).-
Methods inherited from class deltix.qsrv.hf.stream.AbstractMessageReader
checkBuffer, decode, getCurrentType, getCurrentTypeIndex, getMessage, getTypes, readHeader, readHeaderWithoutVersion, readVersion
-
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
-
-
-
-
Constructor Detail
-
MessageReader2
public MessageReader2(java.io.InputStream in, long inLength, boolean unzip, int bufferSize, TypeLoader bindLoader) throws java.io.IOException- Throws:
java.io.IOException
-
MessageReader2
protected MessageReader2(java.io.InputStream in, long inLength, boolean unzip, int bufferSize, TypeLoader bindLoader, RecordClassDescriptor[] types) throws java.io.IOException- Throws:
java.io.IOException
-
MessageReader2
protected MessageReader2(java.io.InputStream input, long inLength, RecordClassDescriptor[] types) throws java.io.IOException- Throws:
java.io.IOException
-
-
Method Detail
-
createRaw
public static MessageReader2 createRaw(java.io.File f) throws java.io.IOException
- Throws:
java.io.IOException
-
create
public static MessageReader2 create(java.io.File f, TypeLoader loader) throws java.io.IOException
- Throws:
java.io.IOException
-
create
public static MessageReader2 create(java.io.File f, int bufferSize, TypeLoader loader) throws java.io.IOException
- Throws:
java.io.IOException
-
create
public static MessageReader2 create(java.io.File f, RecordClassDescriptor[] types) throws java.io.IOException
- Throws:
java.io.IOException
-
readVersion
public static byte readVersion(java.io.File f) throws java.io.IOException- Throws:
java.io.IOException
-
readHeader
protected RecordClassDescriptor[] readHeader() throws java.io.IOException
- Throws:
java.io.IOException
-
isAtEnd
public boolean isAtEnd()
- Specified by:
isAtEndin interfacedeltix.util.concurrent.AbstractCursor
-
next
public boolean next()
- Specified by:
nextin interfacedeltix.util.concurrent.AbstractCursor
-
close
public void close()
- Specified by:
closein interfacejava.lang.AutoCloseable- Specified by:
closein interfacejava.io.Closeable- Specified by:
closein interfacedeltix.util.lang.Disposable
-
getProgress
public double getProgress()
- Specified by:
getProgressin interfacedeltix.data.stream.ConsumableMessageSource<deltix.qsrv.hf.pub.InstrumentMessage>
-
subscribeToAllTypes
public void subscribeToAllTypes()
Description copied from interface:TypeSubscriptionControllerSubscribe to all available types (no filtering).- Specified by:
subscribeToAllTypesin interfaceTypeSubscriptionController
-
addTypes
public void addTypes(java.lang.String... names)
Description copied from interface:TypeSubscriptionControllerAdd the specified type names to subscription.- Specified by:
addTypesin interfaceTypeSubscriptionController
-
setTypes
public void setTypes(java.lang.String... names)
Description copied from interface:TypeSubscriptionControllerSubscribe to specified types.- Specified by:
setTypesin interfaceTypeSubscriptionController
-
removeTypes
public void removeTypes(java.lang.String... names)
Description copied from interface:TypeSubscriptionControllerRemove the specified types from subscription.- Specified by:
removeTypesin interfaceTypeSubscriptionController
-
subscribeToAllEntities
public void subscribeToAllEntities()
Description copied from interface:EntitySubscriptionControllerSubscribe to all available entities.- Specified by:
subscribeToAllEntitiesin interfaceEntitySubscriptionController
-
clearAllEntities
public void clearAllEntities()
Description copied from interface:EntitySubscriptionControllerSwitch to selective subscription mode (if necessary) and clear the list.- Specified by:
clearAllEntitiesin interfaceEntitySubscriptionController
-
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
-
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
-
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
-
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
-
main
public static void main(java.lang.String[] args) throws java.io.IOException- Throws:
java.io.IOException
-
-