Package com.ibm.mq.headers.pcf
Class MQCFH
java.lang.Object
com.ibm.mq.jmqi.JmqiObject
com.ibm.mq.headers.internal.Header
com.ibm.mq.headers.pcf.PCFHeader
com.ibm.mq.headers.pcf.MQCFH
MQCFH (PCF header) header class.
struct tagMQCFH {
MQLONG Type; // Structure type
MQLONG StrucLength; // Structure length
MQLONG Version; // Structure version number
MQLONG Command; // Command identifier
MQLONG MsgSeqNumber; // Message sequence number
MQLONG Control; // Control options
MQLONG CompCode; // Completion code
MQLONG Reason; // Reason code qualifying completion code
MQLONG ParameterCount; // Count of parameter structures
};
-
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, delegateFields inherited from class com.ibm.mq.jmqi.JmqiObject
COMP_JM, COMP_JN, COMP_JO -
Constructor Summary
ConstructorsConstructorDescriptionMQCFH()Constructs an MQCFH instance with default field values.MQCFH(int command, int parameterCount) Initializes an MQCFH instance with the specified command and parameter count.Constructs an MQCFH instance populated from an MQMessage.Constructs an MQCFH instance populated from a DataInput source. -
Method Summary
Modifier and TypeMethodDescriptionbooleanReturns true when invoked with another MQCFH instance with the same type, parameter, operator and value.intgets the command identifierintgets the completion codeintgets the control optionsintgets the message sequence numberintgets the count of parameter structuresintgets the reason code qualifying completion codeintGet the length of the structure.intgetType()gets the structure typeintgets the structure version numbervoidsetCommand(int value) sets the command identifiervoidsetCompCode(int value) sets the completion codevoidsetControl(int value) sets the control optionsvoidsetMsgSeqNumber(int value) sets the message sequence numbervoidsetParameterCount(int value) sets the count of parameter structuresvoidsetReason(int value) sets the reason code qualifying completion codestatic intwrite(DataOutput message, int command, int parameterCount, int type, int version) A convenience method for writing an MQCFH header structure with the specified values to a message.static intA convenience method for writing an MQCFH header structure with the specified values to a message.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, size, store, store, toString, type, validate, write, writeMethods inherited from class com.ibm.mq.jmqi.JmqiObject
getJmqiEnvironment
-
Constructor Details
-
MQCFH
public MQCFH()Constructs an MQCFH instance with default field values. -
MQCFH
Constructs an MQCFH instance populated from an MQMessage.- Parameters:
message- the message to read- Throws:
MQDataException- if the message content does not yield a valid MQCFH stuctureIOException- if there is a problem reading the message content
-
MQCFH
Constructs an MQCFH 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 MQCFH stuctureIOException- if there is a problem reading the message content
-
MQCFH
public MQCFH(int command, int parameterCount) Initializes an MQCFH instance with the specified command and parameter count. Other values are set as for the no-args constructor.- Parameters:
command- Identifies the operator that is being used to evaluate whether the parameter satisfies the filter-valueparameterCount- count of parameter structures
-
-
Method Details
-
write
A convenience method for writing an MQCFH header structure with the specified values to a message.- Parameters:
message- the message to write to (Should be a DataOutput object, but inheritance issues stop that)command- the PCF command (MQCMD_* constants are defined in the CMQCFC class)parameterCount- the number of parameter structures (MQCFIN, MQCFIL, MQCFST or MQCFSL) to follow the PCF header- Returns:
- the number of bytes written
- Throws:
IOException- if there is a problem writing the message content
-
write
public static int write(DataOutput message, int command, int parameterCount, int type, int version) throws IOException A convenience method for writing an MQCFH header structure with the specified values to a message.- Parameters:
message- the message to write tocommand- the PCF command (MQCMD_* constants are defined in the CMQCFC class)parameterCount- the number of parameter structures (MQCFIN, MQCFIL, MQCFST etc.) to follow the PCF headertype- the PCF message typeversion- message version- Returns:
- the number of bytes written
- Throws:
IOException- if there is a problem writing the message content
-
equals
Returns true when invoked with another MQCFH instance with the same type, parameter, operator and value. -
getType
public int getType()gets the structure type -
getStrucLength
public int getStrucLength()Get the length of the structure.- Returns:
- the structure length.
-
getVersion
public int getVersion()gets the structure version number- Returns:
- the structure version number
-
getCommand
public int getCommand()gets the command identifier- Returns:
- the command identifier
-
setCommand
public void setCommand(int value) sets the command identifier- Parameters:
value- the command identifier
-
getMsgSeqNumber
public int getMsgSeqNumber()gets the message sequence number- Returns:
- the message sequence number
-
setMsgSeqNumber
public void setMsgSeqNumber(int value) sets the message sequence number- Parameters:
value- the message sequence number
-
getControl
public int getControl()gets the control options- Returns:
- the control options
-
setControl
public void setControl(int value) sets the control options- Parameters:
value- the control options
-
getCompCode
public int getCompCode()gets the completion code- Returns:
- the completion code
-
setCompCode
public void setCompCode(int value) sets the completion code- Parameters:
value- the completion code
-
getReason
public int getReason()gets the reason code qualifying completion code- Returns:
- the reason code qualifying completion code
-
setReason
public void setReason(int value) sets the reason code qualifying completion code- Parameters:
value- the reason code qualifying completion code
-
getParameterCount
public int getParameterCount()gets the count of parameter structures- Returns:
- the count of parameter structures
-
setParameterCount
public void setParameterCount(int value) sets the count of parameter structures- Parameters:
value- the count of parameter structures
-