AdroitLogic UltraESB v1.7.0

org.adroitlogic.ultraesb.api.mediation
Interface ProtocolBufferSupport


public interface ProtocolBufferSupport

The protocol buffer support interface enabling the protocol buffer features to the mediation

Since:
1.7.0

Method Summary
 void convertToProtocolBuffer(Message message, java.lang.Class typeClass)
          Convert the given message to a message of type ProtocolBufferMessage with a protocol buffer Message type passed in with the typeClass.
 void convertToProtocolBuffer(Message message, java.lang.String descFile)
          Convert the given message to a message of type ProtocolBufferMessage with a protocol buffer DynamicMessage as the message type.
 java.lang.Object getMessage(Message message, java.lang.Class typeClass)
          Gets the protocol buffer message as a parsed message of type T from the given message.
 void setMessage(Message message, java.lang.Object object)
          Sets the message of a protocol buffer message, from either a type of a protocol buffer Message interface or a protocol buffer Message.Builder interface into the given message.
 

Method Detail

convertToProtocolBuffer

void convertToProtocolBuffer(Message message,
                             java.lang.String descFile)
Convert the given message to a message of type ProtocolBufferMessage with a protocol buffer DynamicMessage as the message type.

Parameters:
message - the message to be converted to a protocol buffer message
descFile - description file for the proto schema, to parse the message as a dynamic message

convertToProtocolBuffer

void convertToProtocolBuffer(Message message,
                             java.lang.Class typeClass)
Convert the given message to a message of type ProtocolBufferMessage with a protocol buffer Message type passed in with the typeClass.

Parameters:
message - the message to be converted to a protocol buffer message
typeClass - the type class of the protocol buffer message to be used for parsing the message

getMessage

java.lang.Object getMessage(Message message,
                            java.lang.Class typeClass)
Gets the protocol buffer message as a parsed message of type T from the given message. The Type needs to be either a protocol buffer DynamicMessage type or any type that is a sub class of a protocol buffer Message interface.

If the format of the passed message is not a ProtocolBufferMessage and the type is definite, (i.e. not DynamicMessage) then the message is converted to a ProtocolBufferMessage in the process of getting the message of the given type.

Parameters:
message - the message to be used to retrieve the protocol buffer message.
typeClass - the type class of the parsed protocol buffer
Returns:
the parsed protocol buffer message of type T

setMessage

void setMessage(Message message,
                java.lang.Object object)
Sets the message of a protocol buffer message, from either a type of a protocol buffer Message interface or a protocol buffer Message.Builder interface into the given message.

The format of the message has to be of type ProtocolBufferMessage for the operation to be successful. A BusRuntimeException will be thrown otherwise.

Parameters:
message - the message to set the protocol buffer message
object - the Message or the Message.Builder to be set as the protocol buffer message

Copyright (c) 2010-2012 AdroitLogic Private Ltd. All rights reserved.