com.devexperts.qd.qtp
Class MessageConsumerAdapter

java.lang.Object
  extended by com.devexperts.qd.qtp.MessageConsumerAdapter
All Implemented Interfaces:
MessageConstants, MessageConsumer
Direct Known Subclasses:
MessageAdapter

public class MessageConsumerAdapter
extends java.lang.Object
implements MessageConsumer, MessageConstants

Implementation of MessageConsumer that does nothing. Error methods in this implementation write message to the log file with Logging.error(java.lang.String) and all functional methods skip incoming data and call handleUnknownMessage(int).


Field Summary
 
Fields inherited from interface com.devexperts.qd.qtp.MessageConstants
MESSAGE_DESCRIBE_PROTOCOL, MESSAGE_DESCRIBE_RECORDS, MESSAGE_DESCRIBE_RESERVED, MESSAGE_HEARTBEAT, MESSAGE_HISTORY_ADD_SUBSCRIPTION, MESSAGE_HISTORY_DATA, MESSAGE_HISTORY_REMOVE_SUBSCRIPTION, MESSAGE_PART, MESSAGE_RAW_DATA, MESSAGE_RMI_CANCEL, MESSAGE_RMI_DESCRIBE_OPERATION, MESSAGE_RMI_DESCRIBE_SUBJECT, MESSAGE_RMI_ERROR, MESSAGE_RMI_REQUEST, MESSAGE_RMI_RESULT, MESSAGE_STREAM_ADD_SUBSCRIPTION, MESSAGE_STREAM_DATA, MESSAGE_STREAM_REMOVE_SUBSCRIPTION, MESSAGE_TEXT_FORMAT_COMMENT, MESSAGE_TEXT_FORMAT_SPECIAL, MESSAGE_TICKER_ADD_SUBSCRIPTION, MESSAGE_TICKER_DATA, MESSAGE_TICKER_REMOVE_SUBSCRIPTION
 
Constructor Summary
MessageConsumerAdapter()
           
 
Method Summary
 java.lang.String getSymbol(char[] chars, int offset, int length)
          Returns symbol used for specified characters or null if not found.
 void handleCorruptedMessage(int message_type)
           
 void handleCorruptedStream()
           
 void handleUnknownMessage(int message_type)
           
protected  void processData(DataIterator iterator, MessageType message)
           
 void processDescribeProtocol(ProtocolDescriptor desc)
          Processes incoming protocol descriptor and returns true if this message consumer understands the protocol that remote peer intends to use.
 void processHistoryAddSubscription(SubscriptionIterator iterator)
          This implementation calls processSubscription(iterator, MessageType.HISTORY_ADD_SUBSCRIPTION).
 void processHistoryData(DataIterator iterator)
          This implementation calls processData(iterator, MessageType.HISTORY_DATA).
 void processHistoryRemoveSubscription(SubscriptionIterator iterator)
          This implementation calls processSubscription(iterator, MessageType.HISTORY_REMOVE_SUBSCRIPTION).
 void processOtherMessage(int message_type, byte[] bytes, int ofs, int len)
          This implementation calls handleUnknownMessage(message_type).
 void processStreamAddSubscription(SubscriptionIterator iterator)
          This implementation calls processSubscription(iterator, MessageType.STREAM_ADD_SUBSCRIPTION).
 void processStreamData(DataIterator iterator)
          This implementation calls processData(iterator, MessageType.STREAM_DATA).
 void processStreamRemoveSubscription(SubscriptionIterator iterator)
          This implementation calls processSubscription(iterator, MessageType.STREAM_REMOVE_SUBSCRIPTION).
protected  void processSubscription(SubscriptionIterator iterator, MessageType message)
           
 void processTickerAddSubscription(SubscriptionIterator iterator)
          This implementation calls processSubscription(iterator, MessageType.TICKER_ADD_SUBSCRIPTION).
 void processTickerData(DataIterator iterator)
          This implementation calls processData(iterator, MessageType.TICKER_DATA).
 void processTickerRemoveSubscription(SubscriptionIterator iterator)
          This implementation calls processSubscription(iterator, MessageType.TICKER_REMOVE_SUBSCRIPTION).
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

MessageConsumerAdapter

public MessageConsumerAdapter()
Method Detail

getSymbol

public java.lang.String getSymbol(char[] chars,
                                  int offset,
                                  int length)
Returns symbol used for specified characters or null if not found.


handleCorruptedStream

public void handleCorruptedStream()
Specified by:
handleCorruptedStream in interface MessageConsumer

handleCorruptedMessage

public void handleCorruptedMessage(int message_type)
Specified by:
handleCorruptedMessage in interface MessageConsumer

handleUnknownMessage

public void handleUnknownMessage(int message_type)
Specified by:
handleUnknownMessage in interface MessageConsumer

processDescribeProtocol

public void processDescribeProtocol(ProtocolDescriptor desc)
Description copied from interface: MessageConsumer
Processes incoming protocol descriptor and returns true if this message consumer understands the protocol that remote peer intends to use.

Specified by:
processDescribeProtocol in interface MessageConsumer

processData

protected void processData(DataIterator iterator,
                           MessageType message)

processSubscription

protected void processSubscription(SubscriptionIterator iterator,
                                   MessageType message)

processTickerData

public void processTickerData(DataIterator iterator)
This implementation calls processData(iterator, MessageType.TICKER_DATA).

Specified by:
processTickerData in interface MessageConsumer

processTickerAddSubscription

public void processTickerAddSubscription(SubscriptionIterator iterator)
This implementation calls processSubscription(iterator, MessageType.TICKER_ADD_SUBSCRIPTION).

Specified by:
processTickerAddSubscription in interface MessageConsumer

processTickerRemoveSubscription

public void processTickerRemoveSubscription(SubscriptionIterator iterator)
This implementation calls processSubscription(iterator, MessageType.TICKER_REMOVE_SUBSCRIPTION).

Specified by:
processTickerRemoveSubscription in interface MessageConsumer

processStreamData

public void processStreamData(DataIterator iterator)
This implementation calls processData(iterator, MessageType.STREAM_DATA).

Specified by:
processStreamData in interface MessageConsumer

processStreamAddSubscription

public void processStreamAddSubscription(SubscriptionIterator iterator)
This implementation calls processSubscription(iterator, MessageType.STREAM_ADD_SUBSCRIPTION).

Specified by:
processStreamAddSubscription in interface MessageConsumer

processStreamRemoveSubscription

public void processStreamRemoveSubscription(SubscriptionIterator iterator)
This implementation calls processSubscription(iterator, MessageType.STREAM_REMOVE_SUBSCRIPTION).

Specified by:
processStreamRemoveSubscription in interface MessageConsumer

processHistoryData

public void processHistoryData(DataIterator iterator)
This implementation calls processData(iterator, MessageType.HISTORY_DATA).

Specified by:
processHistoryData in interface MessageConsumer

processHistoryAddSubscription

public void processHistoryAddSubscription(SubscriptionIterator iterator)
This implementation calls processSubscription(iterator, MessageType.HISTORY_ADD_SUBSCRIPTION).

Specified by:
processHistoryAddSubscription in interface MessageConsumer

processHistoryRemoveSubscription

public void processHistoryRemoveSubscription(SubscriptionIterator iterator)
This implementation calls processSubscription(iterator, MessageType.HISTORY_REMOVE_SUBSCRIPTION).

Specified by:
processHistoryRemoveSubscription in interface MessageConsumer

processOtherMessage

public void processOtherMessage(int message_type,
                                byte[] bytes,
                                int ofs,
                                int len)
This implementation calls handleUnknownMessage(message_type).

Specified by:
processOtherMessage in interface MessageConsumer