|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectcom.devexperts.qd.qtp.AbstractMessageVisitor
com.devexperts.qd.qtp.MessageOutputStreamWriter
public class MessageOutputStreamWriter
Writes messages into specified output stream using specified byte array composer.
Constructor Summary | |
---|---|
MessageOutputStreamWriter(AbstractByteArrayComposer composer,
java.io.OutputStream out)
|
Method Summary | |
---|---|
void |
close()
|
void |
flush()
|
void |
messagesAvailable(MessageProvider provider)
Notifies this listener that some messages are available in the specified QTP message provider. |
boolean |
visitData(DataProvider provider,
MessageType message)
This method consumes available data for data message from the given data provider. |
boolean |
visitOtherMessage(int messageType,
byte[] messageBytes,
int offset,
int length)
This implementation simply skips all unknown messages. |
boolean |
visitSubscription(SubscriptionProvider provider,
MessageType message)
This method consumes available subscription for subscription message from the given subscription provider. |
Methods inherited from class com.devexperts.qd.qtp.AbstractMessageVisitor |
---|
visitDescribeProtocol, visitHistoryAddSubscription, visitHistoryData, visitHistoryRemoveSubscription, visitStreamAddSubscription, visitStreamData, visitStreamRemoveSubscription, visitTickerAddSubscription, visitTickerData, visitTickerRemoveSubscription |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Constructor Detail |
---|
public MessageOutputStreamWriter(AbstractByteArrayComposer composer, java.io.OutputStream out)
Method Detail |
---|
public boolean visitData(DataProvider provider, MessageType message)
AbstractMessageVisitor
visitData
in interface MessageVisitor
visitData
in class AbstractMessageVisitor
false
if it had retrieved all available data and no data left,
true
if more data remains to be consumedpublic boolean visitSubscription(SubscriptionProvider provider, MessageType message)
AbstractMessageVisitor
visitSubscription
in interface MessageVisitor
visitSubscription
in class AbstractMessageVisitor
false
if it had retrieved all available subscription and nothing left,
true
if more subscription remains to be consumedpublic boolean visitOtherMessage(int messageType, byte[] messageBytes, int offset, int length)
AbstractMessageVisitor
visitOtherMessage
in interface MessageVisitor
visitOtherMessage
in class AbstractMessageVisitor
messageType
- integer number representing a type of the message.messageBytes
- array containing message data.offset
- position of the first byte of message data in messageBytes
array.length
- number of bytes starting from offset in
messageBytes
related to this message.
- Returns:
- true if the whole message was not processed because the visitor is full
and false if the message was successfully processed.
public void close() throws java.io.IOException
close
in interface java.io.Closeable
java.io.IOException
public void flush() throws java.io.IOException
flush
in interface java.io.Flushable
java.io.IOException
public void messagesAvailable(MessageProvider provider)
MessageListener
messagesAvailable
in interface MessageListener
|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |