com.ibm.mq.headers
Class MQRFH2
- java.lang.Object
- com.ibm.mq.jmqi.JmqiObject
- com.ibm.mq.headers.internal.Header
- com.ibm.mq.headers.MQRFH2
All implemented interfaces:
- public class MQRFH2
- extends com.ibm.mq.headers.internal.Header
- implements MQChainable
Nested Class Summary
Nested classes/interfaces inherited from interface com.ibm.mq.headers.MQHeader |
---|
MQHeader.Field |
Field Summary
Fields inherited from class com.ibm.mq.headers.internal.Header |
---|
DEFAULT_CCSID, DEFAULT_ENCODING, sccsid |
Fields inherited from class com.ibm.mq.jmqi.JmqiObject |
---|
COMP_JM, COMP_JN, COMP_JO |
Constructor Summary
Constructor and Description |
---|
MQRFH2()
Constructs an MQRFH2 instance with default field values.
|
MQRFH2(java.io.DataInput message)
Constructs an MQRFH2 instance populated from an MQMessage.
|
MQRFH2(java.io.DataInput message,int encoding,int characterSet)
Constructs an MQRFH2 instance populated from a DataInput source.
|
Method Summary
Modifier and Type | Method and Description |
---|---|
|
format()
|
|
getBooleanFieldValue(java.lang.String folder,java.lang.String field)
Get the boolean value of the specified field
|
|
getByteFieldValue(java.lang.String folder,java.lang.String field)
Get the byte value of the specified field
|
|
getBytesFieldValue(java.lang.String folder,java.lang.String field)
Get the byte array value of the specified field
|
|
getCharFieldValue(java.lang.String folder,java.lang.String field)
Get the byte value of the specified field
|
|
getCodedCharSetId()
Get the Character set identifier of data that follows.
|
|
getDoubleFieldValue(java.lang.String folder,java.lang.String field)
Get the double precision floating point value of the specified field
|
|
getEncoding()
Get the numeric encoding of the data that follows.
|
|
getFieldValue(java.lang.String folder,java.lang.String tag)
Returns the contents of the first field with the specified name from within a folder string, or
null if no such field is present.
|
|
getFieldValue(java.lang.String folder,java.lang.String field,int occurrence)
Returns the contents of the nth field with the specified name from within a folder
string, or null if no such field is present.
|
|
getFieldValues(java.lang.String folder,java.lang.String field)
Returns a list containing all occurrences of field values matching the specified field name in
the folder.
|
|
getFlags()
get the flags from the header
|
|
getFloatFieldValue(java.lang.String folder,java.lang.String field)
Get the floating point value of the specified field
|
|
getFolderContent(java.lang.String name)
Deprecated.
|
|
getFolderStrings()
Returns the contents of the variable part of the structure as an array of Strings.
|
|
getFormat()
Get the format name of data that follows NameValueString
|
|
getIntFieldValue(java.lang.String folder,java.lang.String field)
Get the integer value of the specified field
|
|
getLongFieldValue(java.lang.String folder,java.lang.String field)
Get the long value of the specified field
|
|
getNameValueCCSID()
get the coded character set for the NameValue data
|
|
getNameValueData()
get the NameValue data
|
|
getNameValueLength()
Returns the
NameValueLength field value.
|
|
getShortFieldValue(java.lang.String folder,java.lang.String field)
Get the short value of the specified field
|
|
getStringFieldValue(java.lang.String folder,java.lang.String field)
Get the String value of the specified field
|
|
getStrucId()
Get the structure identifier; the value will be MQRFH_STRUC_ID
|
|
getStrucLength()
Get the length of the structure.
|
|
getVersion()
Get the Structure version number
|
|
nextCharacterSet()
|
|
nextCharacterSet(int value)
|
|
nextEncoding()
|
|
nextEncoding(int value)
|
|
nextFormat()
|
|
nextFormat(java.lang.String value)
|
|
read(java.io.DataInput input,int encoding,int characterSet)
Initialise this Header from the specified data source
|
|
setByteFieldValue(java.lang.String folder,java.lang.String field,byte value)
Set the byte value of the specified field
|
|
setCharFieldValue(java.lang.String folder,java.lang.String field,char value)
Set the short value of the specified field
|
|
setCodedCharSetId(int value)
Set the Character set identifier of data that follows.
|
|
setDoubleFieldValue(java.lang.String folder,java.lang.String field,double value)
Set the double precision floating point value of the specified field
|
|
setEncoding(int value)
Set the numeric encoding of the data that follows.
|
|
setFieldValue(java.lang.String folder,java.lang.String field,java.lang.Object value)
set value of a field
|
|
setFieldValues(java.lang.String folder,java.lang.String field,java.util.List values)
set the values of a multi-valued field
|
|
setFlags(int value)
set the flags on the header
|
|
setFloatFieldValue(java.lang.String folder,java.lang.String field,float value)
Set the floating point value of the specified field
|
|
setFolderContent(java.lang.String name,java.lang.String content)
Deprecated.
|
|
setFolderStrings(java.lang.String[] folders)
Replaces content of the variable part of the MQRFH2 structure with the specified array of
strings.
|
|
setFormat(java.lang.String value)
Set the format name of data that follows NameValueString
|
|
setIntFieldValue(java.lang.String folder,java.lang.String field,int value)
Set the integer value of the specified field
|
|
setLongFieldValue(java.lang.String folder,java.lang.String field,long value)
Set the long value of the specified field
|
|
setNameValueCCSID(int value)
set the coded character set for the NameValue data
|
|
setNameValueData(byte[] value)
Sets the
NameValueData field.
|
|
setNameValueData(java.lang.String value)
Sets the
NameValueData field.
|
|
setShortFieldValue(java.lang.String folder,java.lang.String field,short value)
Set the short value of the specified field
|
|
size()
Get the size of this header
|
|
toString()
|
|
write(java.io.DataOutput output,int encoding,int characterSet)
write this Header to the specified location
|
Methods inherited from class com.ibm.mq.headers.internal.Header |
---|
characterSet, encoding, fields, getBytesValue, getCharValue, getCharValue, getIntValue, getJmqiEnv, getStringValue, getValue, headerType, read, read, setBytesValue, setCharValue, setCharValue, setIntValue, setStringValue, setValue, store, store, type, validate, write |
Methods inherited from class java.lang.Object |
---|
equals, getClass, hashCode, notify, notifyAll, wait, wait, wait |
Constructor Detail
MQRFH2
- public MQRFH2()
Constructs an MQRFH2 instance with default field values.
MQRFH2
- public MQRFH2(java.io.DataInput message)
- throws MQDataException
- java.io.IOException
Constructs an MQRFH2 instance populated from an MQMessage.
Parameters:
message
- the message to read Throws:
MQDataException
- if the message content does not yield a valid MQRFH2 stucture java.io.IOException
- if there is a problem reading the message content MQRFH2
- public MQRFH2(java.io.DataInput message,
- int encoding,
- int characterSet)
- throws MQDataException
- java.io.IOException
Constructs an MQRFH2 instance populated from a DataInput source.
Parameters:
message
- the MQMessage or other DataInput source to read encoding
- the initial numeric encoding of the data in the message characterSet
- the initial CCSID of the data in the message Throws:
MQDataException
- if the message content does not yield a valid MQRFH2 stucture java.io.IOException
- if there is a problem reading the message content Method Detail
read
- public int read(java.io.DataInput input,
- int encoding,
- int characterSet)
- throws java.io.IOException
- MQDataException
Initialise this Header from the specified data source
Parameters:
input
- the data source encoding
- the encoding mechanism for integer data characterSet
- the CCSID applied to data in the source Returns:
the amount of data read
Throws:
java.io.IOException
write
- public int write(java.io.DataOutput output,
- int encoding,
- int characterSet)
- throws java.io.IOException
write this Header to the specified location
Specified by:
Overrides:
write
in class com.ibm.mq.headers.internal.Header
Parameters:
output
- the data location encoding
- the encoding mechanism for integer data characterSet
- the CCSID applied to data in the data location Returns:
the amount of data written
Throws:
java.io.IOException
size
- public int size()
Get the size of this header
nextEncoding
- public int nextEncoding()
Description copied from interface:
MQChainable
Returns the numeric encoding of the next header or message content.
Specified by:
nextEncoding
in interface MQChainable
nextEncoding
- public void nextEncoding(int value)
Description copied from interface:
MQChainable
Sets the numeric encoding of the next header or message content.
Specified by:
nextEncoding
in interface MQChainable
nextCharacterSet
- public int nextCharacterSet()
Description copied from interface:
MQChainable
Returns the CCSID of the next header or message content.
Specified by:
nextCharacterSet
in interface MQChainable
nextCharacterSet
- public void nextCharacterSet(int value)
Description copied from interface:
MQChainable
Sets the CCSID of the next header or message content.
Specified by:
nextCharacterSet
in interface MQChainable
nextFormat
- public java.lang.String nextFormat( )
Description copied from interface:
MQChainable
Returns the format of the next header or message content.
Specified by:
nextFormat
in interface MQChainable
nextFormat
- public void nextFormat(java.lang.String value)
Description copied from interface:
MQChainable
Sets the format of the next header or message content.
Specified by:
nextFormat
in interface MQChainable
format
- public java.lang.String format( )
Description copied from interface:
MQChainable
Returns the format associated with this header object or message content.
Specified by:
format
in interface MQChainable
getStrucId
- public java.lang.String getStrucId( )
Get the structure identifier; the value will be MQRFH_STRUC_ID
Returns:
the structure identifier
getVersion
- public int getVersion()
Get the Structure version number
Returns:
the Structure version number
getStrucLength
- public int getStrucLength()
Get the length of the structure.
Returns:
the structure length.
getEncoding
- public int getEncoding()
Get the numeric encoding of the data that follows.
Returns:
the numeric encoding. A combination of MQENC_* values.
setEncoding
- public void setEncoding(int value)
Set the numeric encoding of the data that follows.
Parameters:
value
- the numeric encoding. A combination of MQENC_* values. getCodedCharSetId
- public int getCodedCharSetId()
Get the Character set identifier of data that follows.
Returns:
the Character set identifier.
setCodedCharSetId
- public void setCodedCharSetId(int value)
Set the Character set identifier of data that follows.
MQCCSI_Q_MGR is not allowable, so we map that to MQCCSI_INHERIT (I think this is the simplest
fix)
Parameters:
value
- the Character set identifier. getFormat
- public java.lang.String getFormat( )
Get the format name of data that follows NameValueString
Returns:
the format name
setFormat
- public void setFormat(java.lang.String value)
Set the format name of data that follows NameValueString
Parameters:
value
- the format name getFlags
- public int getFlags()
get the flags from the header
Returns:
the flags
setFlags
- public void setFlags(int value)
set the flags on the header
Parameters:
value
- the flags getNameValueCCSID
- public int getNameValueCCSID()
get the coded character set for the NameValue data
Returns:
the NameValue data
setNameValueCCSID
- public void setNameValueCCSID(int value)
set the coded character set for the NameValue data
Parameters:
value
- the coded character set for the NameValue data getNameValueLength
- public int getNameValueLength()
Returns the
NameValueLength
field value.
Note: There is no setNameValueLength method. Setting the NameValueData field causes the NameValueLength and StrucLength field values to be updated accordingly.
getNameValueData
- public byte[] getNameValueData( )
get the NameValue data
Returns:
the NameValue data
setNameValueData
- public void setNameValueData(byte[] value)
Sets the
NameValueData
field. This causes the NameValueLength and StrucLength field
values to be updated accordingly, but the NameValueCCSID field is not modified.
setNameValueData
- public void setNameValueData(java.lang.String value)
- throws java.io.IOException
Sets the
NameValueData
field. This causes the NameValueLength and StrucLength field
values to be updated accordingly. The string data is converted to the CCSID indicated in the
NameValueCCSID field.
Throws:
java.io.IOException
getFolderStrings
- public java.lang.String[] getFolderStrings( )
- throws java.io.IOException
Returns the contents of the variable part of the structure as an array of Strings. This is
equivalent to an array of
NameValueData
strings.
Throws:
java.io.IOException
setFolderStrings
- public void setFolderStrings(java.lang.String[] folders)
- throws java.io.IOException
Replaces content of the variable part of the MQRFH2 structure with the specified array of
strings. The
strucLength
field is updated accordingly.
Throws:
java.io.IOException
getFolderContent
- @Deprecated
- public java.lang.String getFolderContent( java.lang.String name)
- throws java.io.IOException
Deprecated.
Returns a string from the MQRFH2 contents corresponding to the named folder, or null if no such
folder is present. The content of the folder string (less the enclosing folder tags) is
returned if there is a match.
Throws:
java.io.IOException
setFolderContent
- public void setFolderContent(java.lang.String name,
- java.lang.String content)
- throws java.io.IOException
Deprecated.
Sets the content of the named folder. If the folder exists, its content is replaced unless the
content argument is null, in which case the folder is removed. If the folder does not exist, it
is added unless the content argument is null.
Throws:
java.io.IOException
getFieldValue
- public java.lang.Object getFieldValue( java.lang.String folder,
- java.lang.String tag)
- throws java.io.IOException
Returns the contents of the first field with the specified name from within a folder string, or
null if no such field is present. The content of the field (less the enclosing field tags) is
returned if there is a match.
Throws:
java.io.IOException
getFieldValue
- public java.lang.Object getFieldValue( java.lang.String folder,
- java.lang.String field,
- int occurrence)
- throws java.io.IOException
Returns the contents of the nth field with the specified name from within a folder
string, or null if no such field is present. The content of the field (less the enclosing field
tags) is returned if there is a match. An
occurrence
of zero gets the first
occurrence of the the named field; occurrence
of 1 get the next occurrence, and so
forth.
Throws:
java.io.IOException
getFieldValues
- public java.util.List getFieldValues( java.lang.String folder,
- java.lang.String field)
- throws java.io.IOException
Returns a list containing all occurrences of field values matching the specified field name in
the folder. The list is empty if there are no matching fields or the folder is not found.
Throws:
java.io.IOException
setFieldValue
- public void setFieldValue(java.lang.String folder,
- java.lang.String field,
- java.lang.Object value)
- throws java.io.IOException
set value of a field
Parameters:
folder
- - the name of the folder containing the field field
- - the field name value
- - the field value Throws:
java.io.IOException
setFieldValues
- public void setFieldValues(java.lang.String folder,
- java.lang.String field,
- java.util.List values)
- throws java.io.IOException
set the values of a multi-valued field
Parameters:
folder
- - the name of the folder containing the field field
- - the field name values
- - the field values Throws:
java.io.IOException
getBooleanFieldValue
- public boolean getBooleanFieldValue( java.lang.String folder,
- java.lang.String field)
- throws java.io.IOException
Get the boolean value of the specified field
Parameters:
folder
- the folder name in the Header field
- the field name in the Header Returns:
the boolean value
Throws:
java.io.IOException
getIntFieldValue
- public int getIntFieldValue(java.lang.String folder,
- java.lang.String field)
- throws java.io.IOException
Get the integer value of the specified field
Parameters:
folder
- the folder name in the Header field
- the field name in the Header Returns:
the integer value
Throws:
java.io.IOException
setIntFieldValue
- public void setIntFieldValue(java.lang.String folder,
- java.lang.String field,
- int value)
- throws java.io.IOException
Set the integer value of the specified field
Parameters:
folder
- the folder name in the Header field
- the field name in the Header value
- the value to set Throws:
java.io.IOException
getByteFieldValue
- public byte getByteFieldValue(java.lang.String folder,
- java.lang.String field)
- throws java.io.IOException
Get the byte value of the specified field
Parameters:
folder
- the folder name in the Header field
- the field name in the Header Returns:
the byte value
Throws:
java.io.IOException
setByteFieldValue
- public void setByteFieldValue(java.lang.String folder,
- java.lang.String field,
- byte value)
- throws java.io.IOException
Set the byte value of the specified field
Parameters:
folder
- the folder name in the Header field
- the field name in the Header value
- the value to set Throws:
java.io.IOException
getShortFieldValue
- public short getShortFieldValue( java.lang.String folder,
- java.lang.String field)
- throws java.io.IOException
Get the short value of the specified field
Parameters:
folder
- the folder name in the Header field
- the field name in the Header Returns:
the short value
Throws:
java.io.IOException
setShortFieldValue
- public void setShortFieldValue( java.lang.String folder,
- java.lang.String field,
- short value)
- throws java.io.IOException
Set the short value of the specified field
Parameters:
folder
- the folder name in the Header field
- the field name in the Header value
- the value to set Throws:
java.io.IOException
getCharFieldValue
- public char getCharFieldValue(java.lang.String folder,
- java.lang.String field)
- throws java.io.IOException
Get the byte value of the specified field
Parameters:
folder
- the folder name in the Header field
- the field name in the Header Returns:
the byte value
Throws:
java.io.IOException
setCharFieldValue
- public void setCharFieldValue(java.lang.String folder,
- java.lang.String field,
- char value)
- throws java.io.IOException
Set the short value of the specified field
Parameters:
folder
- the folder name in the Header field
- the field name in the Header value
- the value to set Throws:
java.io.IOException
getLongFieldValue
- public long getLongFieldValue(java.lang.String folder,
- java.lang.String field)
- throws java.io.IOException
Get the long value of the specified field
Parameters:
folder
- the folder name in the Header field
- the field name in the Header Returns:
the long value
Throws:
java.io.IOException
setLongFieldValue
- public void setLongFieldValue(java.lang.String folder,
- java.lang.String field,
- long value)
- throws java.io.IOException
Set the long value of the specified field
Parameters:
folder
- the folder name in the Header field
- the field name in the Header value
- the value to set Throws:
java.io.IOException
getFloatFieldValue
- public float getFloatFieldValue( java.lang.String folder,
- java.lang.String field)
- throws java.io.IOException
Get the floating point value of the specified field
Parameters:
folder
- the folder name in the Header field
- the field name in the Header Returns:
the floating point value
Throws:
java.io.IOException
setFloatFieldValue
- public void setFloatFieldValue( java.lang.String folder,
- java.lang.String field,
- float value)
- throws java.io.IOException
Set the floating point value of the specified field
Parameters:
folder
- the folder name in the Header field
- the field name in the Header value
- the value to set Throws:
java.io.IOException
getDoubleFieldValue
- public double getDoubleFieldValue( java.lang.String folder,
- java.lang.String field)
- throws java.io.IOException
Get the double precision floating point value of the specified field
Parameters:
folder
- the folder name in the Header field
- the field name in the Header Returns:
the double precision floating point value
Throws:
java.io.IOException
setDoubleFieldValue
- public void setDoubleFieldValue( java.lang.String folder,
- java.lang.String field,
- double value)
- throws java.io.IOException
Set the double precision floating point value of the specified field
Parameters:
folder
- the folder name in the Header field
- the field name in the Header value
- the value to set Throws:
java.io.IOException
getBytesFieldValue
- public byte[] getBytesFieldValue( java.lang.String folder,
- java.lang.String field)
- throws java.io.IOException
Get the byte array value of the specified field
Parameters:
folder
- the folder name in the Header field
- the field name in the Header Returns:
the byte array
Throws:
java.io.IOException
getStringFieldValue
- public java.lang.String getStringFieldValue( java.lang.String folder,
- java.lang.String field)
- throws java.io.IOException
Get the String value of the specified field
Parameters:
folder
- the folder name in the Header field
- the field name in the Header Returns:
the String value
Throws:
java.io.IOException
toString
- public java.lang.String toString( )
Overrides:
toString
in class com.ibm.mq.headers.internal.Header
See Also:
Object.toString()