public class MQHeaderList
extends java.util.AbstractList
| Constructor and Description |
|---|
MQHeaderList()
Default constructor
|
MQHeaderList(java.io.DataInput message)
Initializes an MQHeaderList from the contents of a message or byte stream using the initial
format, encoding and CCSID given by the MQMD fields in the message.
|
MQHeaderList(java.io.DataInput message,
boolean readBody)
Initializes an MQHeaderList from the contents of a message or byte stream using the initial
format, encoding and CCSID given by the MQMD fields in the message.
|
MQHeaderList(java.io.DataInput message,
java.lang.String format,
int encoding,
int characterSet)
Initializes an MQHeaderList from the contents of a message or byte stream using the given
initial format, encoding and CCSID.
|
MQHeaderList(MQHeader[] headers)
Constructs an MQHeaderList from an array of headers.
|
MQHeaderList(java.lang.String format)
Initializes an MQHeaderList for reading a byte stream starting with the specified initial
format.
|
| Modifier and Type | Method and Description |
|---|---|
void |
add(int index,
java.lang.Object header)
Inserts a new MQHeader instance before the given position in the list.
|
boolean |
add(java.lang.Object header)
Adds a new MQHeader instance to the end of the list.
|
MQData |
asMQData()
Returns an MQData adapter for this MQHeaderList.
|
java.lang.Object |
get(int index)
Returns the header object at the given position in the list.
|
java.lang.Object |
getBody()
Returns the body object obtained during the last read operation if the readBody argument
was specified.
|
java.lang.String |
getFormat()
Returns the format for the first item in the header list.
|
int |
indexOf(java.lang.String type)
Returns the index of the first header in the list of the specified header type, or -1 if not
found.
|
int |
read(java.io.DataInput message)
Populates an MQHeaderList from the contents of a message or byte stream using the initial
format, encoding and CCSID given by the MQMD fields in the message.
|
int |
read(java.io.DataInput message,
boolean readBody)
Populates an MQHeaderList from the contents of a message or byte stream and reads the message
body if the readBody argument is true.
|
int |
read(java.io.DataInput message,
int encoding,
int characterSet)
Populates an MQHeaderList from the contents of a message or byte stream using the given initial
format, encoding and CCSID.
|
int |
read(java.io.DataInput message,
int encoding,
int characterSet,
boolean readBody)
Populates an MQHeaderList from the contents of a message or byte stream and reads the message
body if the readBody argument is true.
|
java.lang.Object |
remove(int index)
Removes the MQHeader at the specified position in this list.
|
java.lang.Object |
set(int index,
java.lang.Object header)
Replaces the MQHeader instance at the given position in the list with the specified value.
|
int |
size()
Returns the number of headers in the list.
|
java.lang.String |
toString()
Returns the string representation of the class instance
|
java.lang.String |
updateHeaderChaining()
Traverses the headers in the list, updating the format field of each Chainable header and
returning the format of the first header for setting into the message descriptor.
|
java.lang.String |
updateHeaderChaining(boolean useBodyFormat)
Deprecated.
No longer required
|
java.lang.String |
updateHeaderChaining(java.lang.String bodyFormat)
Updates the format of headers in the list, setting the last one to the given body format.
|
int |
write(java.io.DataOutput message)
Writes the headers in this MQHeaderList to the target message.
|
int |
write(java.io.DataOutput message,
boolean writeBody)
Writes the headers in this MQHeaderList to the target message, and writes the body if the
writeBody argument is true and a body has previously been read.
|
int |
write(java.io.DataOutput message,
int encoding,
int characterSet)
Writes the headers in this MQHeaderList to the target message using the given encoding and
CCSID.
|
int |
write(java.io.DataOutput message,
int encoding,
int characterSet,
boolean writeBody)
Writes the headers in this MQHeaderList to the target message using the given encoding and
CCSID, and writes the body if the writeBody argument is true and a body has previously
been read.
|
addAll, clear, equals, hashCode, indexOf, iterator, lastIndexOf, listIterator, listIterator, subListpublic MQHeaderList()
public MQHeaderList(java.lang.String format)
format - The format to intialisepublic MQHeaderList(MQHeader[] headers)
headers - The array of headerspublic MQHeaderList(java.io.DataInput message)
throws MQDataException,
java.io.IOException
message - the message.MQDataException - If the call failsjava.io.IOException - If there is an IO errorpublic MQHeaderList(java.io.DataInput message,
boolean readBody)
throws MQDataException,
java.io.IOException
message - the message.readBody - a flag to indicate whether message body is to be readMQDataException - If the call failsjava.io.IOException - If there is an IO errorpublic MQHeaderList(java.io.DataInput message,
java.lang.String format,
int encoding,
int characterSet)
throws MQDataException,
java.io.IOException
message - the message.format - the message format (see CMQC.MQFMT_* for values)encoding - the numeric encoding. see (CMQC.MQENC_* for values).characterSet - the Coded Character Set Identifier.MQDataException - If the call failsjava.io.IOException - If there is an IO errorpublic java.lang.String updateHeaderChaining()
public java.lang.String updateHeaderChaining(boolean useBodyFormat)
useBodyFormat - Indicates if bodyFormat has to be usedupdateHeaderChaining()public java.lang.String updateHeaderChaining(java.lang.String bodyFormat)
bodyFormat - the header format (see CMQC.MQFMT_* for values)updateHeaderChaining()public int read(java.io.DataInput message)
throws MQDataException,
java.io.IOException
message - the message.MQDataException - If the call failsjava.io.IOException - If there is an IO errorpublic int read(java.io.DataInput message,
boolean readBody)
throws MQDataException,
java.io.IOException
message - the message.readBody - a flag to indicate whether message body is to be readMQDataException - If the call failsjava.io.IOException - If there is an IO errorpublic int read(java.io.DataInput message,
int encoding,
int characterSet)
throws MQDataException,
java.io.IOException
message - the message.encoding - the numeric encoding. see (CMQC.MQENC_* for values).characterSet - the Coded Character Set Identifier.MQDataException - If the call failsjava.io.IOException - If there is an IO errorpublic int read(java.io.DataInput message,
int encoding,
int characterSet,
boolean readBody)
throws MQDataException,
java.io.IOException
message - the message.encoding - the numeric encoding. see (CMQC.MQENC_* for values).characterSet - the Coded Character Set Identifier.readBody - Indicates if message body has to be read alsoMQDataException - If the call failsjava.io.IOException - If there is an IO errorpublic int write(java.io.DataOutput message)
throws java.io.IOException
message - the message.java.io.IOException - If there is an IO errorpublic int write(java.io.DataOutput message,
boolean writeBody)
throws java.io.IOException
message - the message.writeBody - whether or not the body should be written to the messagejava.io.IOException - If there is an IO errorpublic int write(java.io.DataOutput message,
int encoding,
int characterSet)
throws java.io.IOException
message - the message.encoding - the numeric encoding. see (CMQC.MQENC_* for values).characterSet - the Coded Character Set Identifier.java.io.IOException - If there is an IO errorpublic int write(java.io.DataOutput message,
int encoding,
int characterSet,
boolean writeBody)
throws java.io.IOException
message - the message.encoding - the numeric encoding. see (CMQC.MQENC_* for values).characterSet - the Coded Character Set Identifier.writeBody - whether or not the body should be written to the messagejava.io.IOException - If there is an IO errorpublic int indexOf(java.lang.String type)
type - identifies the header type requiredpublic java.lang.String getFormat()
public java.lang.Object getBody()
public java.lang.Object get(int index)
get in interface java.util.Listget in class java.util.AbstractListindex - the position requiredpublic int size()
size in interface java.util.Collectionsize in interface java.util.Listsize in class java.util.AbstractCollectionpublic void add(int index,
java.lang.Object header)
add in interface java.util.Listadd in class java.util.AbstractListindex - the position at which to insertheader - the MQHeader to insertpublic boolean add(java.lang.Object header)
add in interface java.util.Collectionadd in interface java.util.Listadd in class java.util.AbstractListheader - the MQHeader to addpublic java.lang.Object remove(int index)
remove in interface java.util.Listremove in class java.util.AbstractListindex - the index of the element to removed.public java.lang.Object set(int index,
java.lang.Object header)
set in interface java.util.Listset in class java.util.AbstractListindex - the position at which to replaceheader - the MQHeader to replace withpublic MQData asMQData()
public java.lang.String toString()
toString in class java.util.AbstractCollectionObject.toString()