|
|||||||||
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 |
---|
Fields inherited from class com.devexperts.qd.qtp.AbstractByteArrayParser |
---|
in, limit, processed, 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 | |
---|---|
ProtocolDescriptor |
getProtocolDescriptor()
Returns current ProtocolDescriptor or null if one was never received in this session. |
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. |
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, removeBytes, setLimit |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
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()
java.lang.UnsupportedOperationException
- when parser was constructed witout describe records mode.public ProtocolDescriptor getProtocolDescriptor()
ProtocolDescriptor
or null
if one was never received in this session.
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 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
|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |