Package 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 ClassesNested 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, delegateFields inherited from class com.ibm.mq.jmqi.JmqiObject
COMP_JM, COMP_JN, COMP_JOFields inherited from interface com.ibm.mq.headers.internal.CachingHeader
sccsid -
Constructor Summary
ConstructorsConstructorDescriptionMQRFH()Constructs an MQRFH instance with default field values.Constructs an MQRFH instance populated from an MQMessage.Constructs an MQRFH instance populated from a DataInput source. -
Method Summary
Modifier and TypeMethodDescriptionformat()intGet the Character set identifier of data that follows.intGet the numeric encoding of the data that follows.intgetFlags()get the flags from the RFH headerGet the format name of data that follows NameValueStringgetNamedValue(String name) get the NameValue dataGet the structure identifier; the value will be MQRFH_STRUC_IDintGet the length of the structure.intGet the Structure version numberintvoidnextCharacterSet(int value) Sets the CCSID of the next header or message content.intvoidnextEncoding(int value) Sets the numeric encoding of the next header or message content.voidnextFormat(String value) Sets the format of the next header or message content.voidsetCodedCharSetId(int value) Set the Character set identifier of data that follows.voidsetEncoding(int value) Set the numeric encoding of the data that follows.voidsetFlags(int value) set the flags on the RFH headervoidSet the format name of data that follows NameValueStringvoidsetNameValueString(String value) set the NameValue dataintsize()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, writeMethods inherited from class com.ibm.mq.jmqi.JmqiObject
getJmqiEnvironmentMethods inherited from class java.lang.Object
equals, getClass, hashCode, notify, notifyAll, wait, wait, waitMethods inherited from interface com.ibm.mq.headers.internal.CachingHeader
discardCachedContent, readCachedContent, writeCachedContent
-
Constructor Details
-
MQRFH
- 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
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 stuctureIOException- if there is a problem reading the message content
-
MQRFH
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 stuctureIOException- if there is a problem reading the message content
-
-
Method Details
-
getNamedValue
- Parameters:
name-- Returns:
- the first occurrence of the named value from the NameValueString.
- Throws:
IOException
-
size
public int size() -
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
Get the format name of data that follows NameValueString- Returns:
- the format name
-
setFormat
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
get the NameValue data- Returns:
- the NameValue data
-
setNameValueString
set the NameValue data- Parameters:
value- the NameValue data
-
nextEncoding
public int nextEncoding()- Specified by:
nextEncodingin interfaceMQChainable- Returns:
- the numeric encoding of the next header or message content.
- See Also:
-
nextEncoding
public void nextEncoding(int value) Description copied from interface:MQChainableSets the numeric encoding of the next header or message content.- Specified by:
nextEncodingin interfaceMQChainable- Parameters:
value- numeric encoding- See Also:
-
nextCharacterSet
public int nextCharacterSet()- Specified by:
nextCharacterSetin interfaceMQChainable- Returns:
- the CCSID of the next header or message content.
- See Also:
-
nextCharacterSet
public void nextCharacterSet(int value) Description copied from interface:MQChainableSets the CCSID of the next header or message content.- Specified by:
nextCharacterSetin interfaceMQChainable- Parameters:
value- character set- See Also:
-
nextFormat
- Specified by:
nextFormatin interfaceMQChainable- Returns:
- the format of the next header or message content.
- See Also:
-
nextFormat
Description copied from interface:MQChainableSets the format of the next header or message content.- Specified by:
nextFormatin interfaceMQChainable- Parameters:
value- format of the header or message content- See Also:
-
format
- Specified by:
formatin interfaceMQChainable- Returns:
- the format associated with this header object or message content.
- See Also:
-