IBM WebSphere Application ServerTM
Release 8

com.ibm.websphere.sca.mq.data
Interface MQHeaderDataBinding

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

public interface MQHeaderDataBinding
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
static java.lang.String COPYRIGHT
           
 
Method Summary
 int getNextCCSID()
          Called by the runtime after the read method and used to "unchain" the WMQ header context chaining.
 int getNextEncoding()
          Called by the runtime after the read method and used to "unchain" the WMQ header context chaining.
 java.lang.String getNextFormat()
          Called by the runtime after the read method and used to "unchain" the WMQ header context chaining.
 boolean isSupportedFormat(java.lang.String format)
          Called by the runtime to determine whether this MQHeaderDataBinding supports a particular WMQ header format.
 void read(java.lang.String format, MQDataInputStream input)
          Read the contents of the an incoming WMQ header into its DataObject representation.
 void setNextCCSID(int ccsid)
          Called by the runtime before the write method and used to "rechain" the WMQ header context chaining.
 void setNextEncoding(int encoding)
          Called by the runtime before the write method and used to "rechain" the WMQ header context chaining.
 void setNextFormat(java.lang.String format)
          Called by the runtime before the write method and used to "rechain" the WMQ header context chaining.
 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

COPYRIGHT

static final java.lang.String COPYRIGHT
See Also:
Constant Field Values
Method Detail

isSupportedFormat

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

void read(java.lang.String format,
          MQDataInputStream input)
          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

void write(java.lang.String format,
           MQDataOutputStream output)
           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

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

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

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

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

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

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.

IBM WebSphere Application ServerTM
Release 8