|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectcom.devexperts.qd.qtp.AbstractByteArrayParser
com.devexperts.qd.qtp.ByteArrayParser
public class ByteArrayParser
The ByteArrayParser
parses QTP messages accumulated
in a linear byte array buffer.
AbstractByteArrayParser
Nested Class Summary | |
---|---|
protected static class |
ByteArrayParser.CorruptedException
This exception is thrown to indicate that either message or stream are corrupted (depending on the method). |
Field Summary | |
---|---|
protected int |
lastCipher
|
protected java.lang.String |
lastSymbol
|
Fields inherited from class com.devexperts.qd.qtp.AbstractByteArrayParser |
---|
in, limit, processed, readAs, recordBuffer, scheme, subscriptionBuffer |
Constructor Summary | |
---|---|
ByteArrayParser(DataScheme scheme)
Constructs parser with a specified scheme in a stateless mode (describe messages are not being parsed). |
|
ByteArrayParser(DataScheme scheme,
boolean parseDescribe)
Constructs parser with a specified scheme and a describe mode. |
Method Summary | |
---|---|
protected void |
doAfterMessageBody(int messageType)
|
protected void |
doAfterMessageHeader()
|
protected void |
doBeforeMessage()
|
protected RecordReader |
getRecordReader(int id)
|
void |
parse(MessageConsumer consumer)
Parses accumulated data and retrieve processed messages to specified MessageConsumer. |
protected int |
parseType()
Parses and return message type. |
protected void |
readRecordData(RecordReader rr,
RecordBuffer buffer,
int cipher,
java.lang.String symbol)
|
protected int |
readRecordId()
|
protected long |
readSubscriptionTime()
|
protected boolean |
readSymbol()
|
void |
receiveSymbol(int cipher,
java.lang.String symbol)
Remembers specified cipher and symbol. |
protected void |
remapRecord(int id,
RecordReader rr)
|
void |
resetSession()
Resets session state for parser with describe mode. |
Methods inherited from class com.devexperts.qd.qtp.AbstractByteArrayParser |
---|
addBytes, ensureCapacity, getBuffer, getLimit, getProcessed, nextMessage, processMessage, processPending, readAs, removeBytes, replaceReadType, resetBuffer, setLimit |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Field Detail |
---|
protected int lastCipher
protected java.lang.String lastSymbol
Constructor Detail |
---|
public ByteArrayParser(DataScheme scheme)
ByteArrayParser(scheme, false)
.
scheme
- data scheme to use.public ByteArrayParser(DataScheme scheme, boolean parseDescribe)
scheme
- data scheme to use.parseDescribe
- If true
, then all kinds of describe messages are parsed
and this instance keeps that information in its state and it shall not be reused for different
communication sessions without resetSession()
call.
Otherwise, the parser is generally almost stateless.Method Detail |
---|
public void resetSession()
resetSession
in class AbstractByteArrayParser
java.lang.UnsupportedOperationException
- when parser was constructed without describe records mode.public void parse(MessageConsumer consumer)
AbstractByteArrayParser
processed
value.
parse
in class AbstractByteArrayParser
consumer
- MessageConsumer to pass parsed messages.protected int parseType() throws ByteArrayParser.CorruptedException
ByteArrayParser.CorruptedException
- if stream is corrupted.protected boolean readSymbol() throws java.io.IOException
java.io.IOException
protected int readRecordId() throws java.io.IOException
java.io.IOException
protected void readRecordData(RecordReader rr, RecordBuffer buffer, int cipher, java.lang.String symbol) throws java.io.IOException
java.io.IOException
protected long readSubscriptionTime() throws java.io.IOException
java.io.IOException
protected void remapRecord(int id, RecordReader rr)
protected RecordReader getRecordReader(int id)
public void receiveSymbol(int cipher, java.lang.String symbol)
SymbolReceiver
receiveSymbol
in interface SymbolReceiver
protected void doBeforeMessage()
protected void doAfterMessageHeader()
protected void doAfterMessageBody(int messageType)
|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |