Platform SDK Java 8.5 API Reference

com.genesyslab.platform.management.protocol.messageserver.runtime
Class MessageProtocolInnerMessageParser

java.lang.Object
  extended by com.genesyslab.platform.management.protocol.messageserver.runtime.MessageProtocolInnerMessageParser

public class MessageProtocolInnerMessageParser
extends java.lang.Object


Nested Class Summary
static interface MessageProtocolInnerMessageParser.ErrorHandler
           
 
Constructor Summary
MessageProtocolInnerMessageParser(ProtocolFactory protocolFactory)
           
MessageProtocolInnerMessageParser(ProtocolFactory protocolFactory, ConnectionConfiguration config)
           
 
Method Summary
 Message parse(byte[] bytes)
          This method will try to extract IMessage object from the given byte array.
 Message parse(byte[] bytes, int pos, int len)
          This method will try to extract IMessage object from the given byte array, beginning from specified position.
 void setErrorHandler(MessageProtocolInnerMessageParser.ErrorHandler errorHandler)
          Message parser can detect some errors which are not critical to message parsing.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

MessageProtocolInnerMessageParser

public MessageProtocolInnerMessageParser(ProtocolFactory protocolFactory)

MessageProtocolInnerMessageParser

public MessageProtocolInnerMessageParser(ProtocolFactory protocolFactory,
                                         ConnectionConfiguration config)
Method Detail

parse

public Message parse(byte[] bytes,
                     int pos,
                     int len)
              throws ProtocolException
This method will try to extract IMessage object from the given byte array, beginning from specified position. In some cases the length of the packed message (4 bytes) can be included in byte array. Note that all parse methods do not expect length or any other data in the buffer. Modify starting position and length accordingly to cut those length or additional data off.

Parameters:
bytes - binary array containing representation of message.
pos - position where message (number of attributes byte) begins.
len - length of binary representation.
Returns:
Parsed message.
Throws:
ProtocolException - if message can't be parsed

parse

public Message parse(byte[] bytes)
              throws ProtocolException
This method will try to extract IMessage object from the given byte array. In some cases the length of the packed message (4 bytes) can be included in byte array. Note that all parse methods do not expect length or any other data in the buffer.

Parameters:
bytes - binary aray containing representation of message
Returns:
Parsed message
Throws:
ProtocolException - if message can't be parsed

setErrorHandler

public void setErrorHandler(MessageProtocolInnerMessageParser.ErrorHandler errorHandler)
Message parser can detect some errors which are not critical to message parsing. One such example is unknown message attributes. Such errors can be reported to ErrorHandler.

Parameters:
errorHandler - erro handler to report non-critical errors

Platform SDK Java 8.5 API Reference

Send comments on this topicTechpubs.webadmin@genesys.com.
Document version: 8.5.302.00
Copyright © 2006–2017 Genesys Telecommunications Laboratories, Inc. All rights reserved.