com.ibm.websphere.sca.mq.data

Interface MQHeaderDataBinding

All Superinterfaces:
commonj.connector.runtime.DataBinding, java.io.Serializable

  1. public interface MQHeaderDataBinding
  2. extends commonj.connector.runtime.DataBinding
A DataBinding represents the mapping between a native data format and an SDO DataObject, and vice-versa.

This interface is an extension of commonj.connector.runtime.DataBinding, and presents a WMQ-specific view which should be implemented for use in WMQ Exports and Imports specifically for support of WMQ headers.

It exposes methods which read and write a WMQ header to and from a WMQ message, as well as exporting which format of WMQ message is supported, and the associated control data: CCSID, encoding and format.

See Also:
DataBinding

Field Summary

Modifier and Type Field and Description
  1. static
  2. java.lang.String
COPYRIGHT

Method Summary

Modifier and Type Method and Description
  1. int
getNextCCSID()
Called by the runtime after the read method and used to "unchain" the WMQ header context chaining.
  1. int
getNextEncoding()
Called by the runtime after the read method and used to "unchain" the WMQ header context chaining.
  1. java.lang.String
getNextFormat()
Called by the runtime after the read method and used to "unchain" the WMQ header context chaining.
  1. boolean
isSupportedFormat(java.lang.String format)
Called by the runtime to determine whether this MQHeaderDataBinding supports a particular WMQ header format.
  1. void
read(java.lang.String format,MQDataInputStream input)
Read the contents of the an incoming WMQ header into its DataObject representation.
  1. void
setNextCCSID(int ccsid)
Called by the runtime before the write method and used to "rechain" the WMQ header context chaining.
  1. void
setNextEncoding(int encoding)
Called by the runtime before the write method and used to "rechain" the WMQ header context chaining.
  1. void
setNextFormat(java.lang.String format)
Called by the runtime before the write method and used to "rechain" the WMQ header context chaining.
  1. void
write(java.lang.String format,MQDataOutputStream output)
Write the header DataObject representation into an outgoing WMQ message header.
Methods inherited from interface commonj.connector.runtime.DataBinding
getDataObject, setDataObject

Field Detail

  1. static final java.lang.String COPYRIGHT
See Also:

Method Detail

isSupportedFormat

  1. boolean isSupportedFormat(java.lang.String format)
Called by the runtime to determine whether this MQHeaderDataBinding supports a particular WMQ header format. The IBM-supplied MQHeaderDataBinding implementations can be overridden by returning the required format from this method.
Parameters:
format - The format to be queried.

read

  1. void read(java.lang.String format,
  2. MQDataInputStream input)
  3. throws java.io.IOException
Read the contents of the an incoming WMQ header into its DataObject representation. Called before the getDataObject method is called by the runtime. An implementation of this method will process the incoming WMQ header by reading from the supplied input stream. It will then parse the data into the appropriate DataObject, created like this:

BOFactory bof =
(BOFactory)ServiceManager.INSTANCE.locateService("com/ibm/websphere/bo/BOFactory");
sampleBO = bof.create("http://namespace", "BOName");

Parameters:
format - In case this MQHeaderDataBinding supports multiple formats, this parameter determines the specific header format for this incoming WMQ header.
input - The input stream wrapping the incoming WMQ header.
Throws:
java.io.IOException - Thrown if an error occurs during reading of the WMQ header.

write

  1. void write(java.lang.String format,
  2. MQDataOutputStream output)
  3. throws java.io.IOException
Write the header DataObject representation into an outgoing WMQ message header. Called after the setDataObject method is called by the runtime.

This method will be the converse of the read method, and will serialize the contents of the DataObject the the wire format in the WMQ message header by writing to the supplied output stream.

Parameters:
format - In case this MQHeaderDataBinding supports multiple formats, this parameter determines the specific header format for this outgoing WMQ header.
output - The output stream wrapping the outgoing WMQ message header.
Throws:
java.io.IOException - Thrown if an error occurs during writing of the WMQ header.

setNextFormat

  1. void setNextFormat(java.lang.String format)
Called by the runtime before the write method and used to "rechain" the WMQ header context chaining.
Parameters:
format - The format of the next header in the chain.

getNextFormat

  1. java.lang.String getNextFormat( )
Called by the runtime after the read method and used to "unchain" the WMQ header context chaining.
Returns:
The format of the next header in the chain.

setNextCCSID

  1. void setNextCCSID(int ccsid)
Called by the runtime before the write method and used to "rechain" the WMQ header context chaining.
Parameters:
ccsid - The CCSID of the next header in the chain.

getNextCCSID

  1. int getNextCCSID()
Called by the runtime after the read method and used to "unchain" the WMQ header context chaining.
Returns:
The CCSID of the next header in the chain.

setNextEncoding

  1. void setNextEncoding(int encoding)
Called by the runtime before the write method and used to "rechain" the WMQ header context chaining.
Parameters:
encoding - The encoding of the next header in the chain.

getNextEncoding

  1. int getNextEncoding()
Called by the runtime after the read method and used to "unchain" the WMQ header context chaining.
Returns:
The encoding of the next header in the chain.