com.ibm.mq.headers
Class MQRFH
- java.lang.Object
-
- com.ibm.mq.jmqi.JmqiObject
-
- com.ibm.mq.headers.internal.Header
-
- com.ibm.mq.headers.MQRFH
-
- All Implemented Interfaces:
- com.ibm.mq.headers.internal.CachingHeader, MQChainable, MQData, MQHeader
public class MQRFH extends com.ibm.mq.headers.internal.Header implements com.ibm.mq.headers.internal.CachingHeader, MQChainable
MQRFH header class.struct tagMQRFH { MQCHAR4 StrucId; /* Structure identifier MQLONG Version; /* Structure version number MQLONG StrucLength; /* Total length of MQRFH including NameValueString MQLONG Encoding; /* Numeric encoding of data that follows NameValueString MQLONG CodedCharSetId; /* Character set identifier of data that follows NameValueString MQCHAR8 Format; /* Format name of data that follows NameValueString MQLONG Flags; /* Flags };
-
-
Nested Class Summary
Nested Classes Modifier and Type Class and Description static interface
MQRFH.NameValuePair
-
Nested classes/interfaces inherited from interface com.ibm.mq.headers.MQHeader
MQHeader.Field
-
-
Field Summary
-
Constructor Summary
Constructors Constructor and Description MQRFH()
Constructs an MQRFH instance with default field values.MQRFH(java.io.DataInput message)
Constructs an MQRFH instance populated from an MQMessage.MQRFH(java.io.DataInput message, int encoding, int characterSet)
Constructs an MQRFH instance populated from a DataInput source.MQRFH(java.lang.String nameValueString)
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method and Description java.lang.String
format()
int
getCodedCharSetId()
Get the Character set identifier of data that follows.int
getEncoding()
Get the numeric encoding of the data that follows.int
getFlags()
get the flags from the RFH headerjava.lang.String
getFormat()
Get the format name of data that follows NameValueStringjava.lang.String
getNamedValue(java.lang.String name)
java.lang.String
getNameValueData()
get the NameValue datajava.lang.String
getStrucId()
Get the structure identifier; the value will be MQRFH_STRUC_IDint
getStrucLength()
Get the length of the structure.int
getVersion()
Get the Structure version numberint
nextCharacterSet()
void
nextCharacterSet(int value)
Sets the CCSID of the next header or message content.int
nextEncoding()
void
nextEncoding(int value)
Sets the numeric encoding of the next header or message content.java.lang.String
nextFormat()
void
nextFormat(java.lang.String value)
Sets the format of the next header or message content.void
setCodedCharSetId(int value)
Set the Character set identifier of data that follows.void
setEncoding(int value)
Set the numeric encoding of the data that follows.void
setFlags(int value)
set the flags on the RFH headervoid
setFormat(java.lang.String value)
Set the format name of data that follows NameValueStringvoid
setNameValueString(java.lang.String value)
set the NameValue dataint
size()
-
Methods inherited from class com.ibm.mq.headers.internal.Header
characterSet, encoding, fields, getBytesValue, getCharValue, getCharValue, getIntValue, getJmqiEnv, getStringValue, getValue, headerType, read, read, read, setBytesValue, setCharValue, setCharValue, setIntValue, setStringValue, setValue, store, store, toString, type, validate, write, write
-
-
-
-
Constructor Detail
-
MQRFH
public MQRFH(java.lang.String nameValueString)
- Parameters:
nameValueString
- Constructs an MQRFH with default values and a NameValueString, which must consist of zero or more whitespace-separated name value pairs. The strucLength field is updated automatically.
-
MQRFH
public MQRFH()
Constructs an MQRFH instance with default field values.
-
MQRFH
public MQRFH(java.io.DataInput message) throws MQDataException, java.io.IOException
Constructs an MQRFH instance populated from an MQMessage.- Parameters:
message
- the message to read- Throws:
MQDataException
- if the message content does not yield a valid MQRFH stucturejava.io.IOException
- if there is a problem reading the message content
-
MQRFH
public MQRFH(java.io.DataInput message, int encoding, int characterSet) throws MQDataException, java.io.IOException
Constructs an MQRFH instance populated from a DataInput source.- Parameters:
message
- the MQMessage or other DataInput source to readencoding
- the initial numeric encoding of the data in the messagecharacterSet
- the initial CCSID of the data in the message- Throws:
MQDataException
- if the message content does not yield a valid MQRFH stucturejava.io.IOException
- if there is a problem reading the message content
-
-
Method Detail
-
getNamedValue
public java.lang.String getNamedValue(java.lang.String name) throws java.io.IOException
- Parameters:
name
-- Returns:
- the first occurrence of the named value from the NameValueString.
- Throws:
java.io.IOException
-
size
public int size()
-
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 RFH header- Returns:
- the flags
-
setFlags
public void setFlags(int value)
set the flags on the RFH header- Parameters:
value
- the flags
-
getNameValueData
public java.lang.String getNameValueData()
get the NameValue data- Returns:
- the NameValue data
-
setNameValueString
public void setNameValueString(java.lang.String value)
set the NameValue data- Parameters:
value
- the NameValue data
-
nextEncoding
public int nextEncoding()
- Specified by:
nextEncoding
in interfaceMQChainable
- Returns:
- the numeric encoding of the next header or message content.
- See Also:
MQChainable.nextEncoding()
-
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 interfaceMQChainable
- See Also:
MQChainable.nextEncoding(int)
-
nextCharacterSet
public int nextCharacterSet()
- Specified by:
nextCharacterSet
in interfaceMQChainable
- Returns:
- the CCSID of the next header or message content.
- See Also:
MQChainable.nextCharacterSet()
-
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 interfaceMQChainable
- See Also:
MQChainable.nextCharacterSet(int)
-
nextFormat
public java.lang.String nextFormat()
- Specified by:
nextFormat
in interfaceMQChainable
- Returns:
- the format of the next header or message content.
- See Also:
MQChainable.nextFormat()
-
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 interfaceMQChainable
- See Also:
MQChainable.nextFormat(java.lang.String)
-
format
public java.lang.String format()
- Specified by:
format
in interfaceMQChainable
- Returns:
- the format associated with this header object or message content.
- See Also:
MQChainable.format()
-
-