|
||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||
SUMMARY: INNER | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object | +--com.ibm.mq.pcf.PCFHeader | +--com.ibm.mq.pcf.PCFMessage
Class encapsulating a PCF message. A PCFMessage typically represents a PCF request or response or an event message, which consists of an MQCFH header followed by a set of PCFParameter structures (type MQCFIN, MQCFIL, MQCFST or MQCFSL). A PCFMessage instance can be constructed and manipulated without direct reference to the PCF header and parameter structures themselves.
A PCFMessage instance can be repopulated for reuse using its initialize methods.
PCFMessageAgent
, Serialized FormField Summary | |
static java.lang.String |
copyright
|
Constructor Summary | |
PCFMessage(int command)
Initializes a PCFMessage as a PCF request with the specified MQCFH command identifier. |
|
PCFMessage(int type,
int command,
int msgSeqNumber,
boolean last)
Initializes a PCFMessage with the specified MQCFH type, command identifier, sequence number and control indicator. |
|
PCFMessage(com.ibm.mq.MQMessage message)
Initializes a PCFMessage from the contents of an MQMessage. |
Method Summary | |
void |
addParameter(int parameter,
int value)
Adds an integer parameter to the PCFMessage. |
void |
addParameter(int parameter,
int[] values)
Adds an integer list parameter to the PCFMessage. |
void |
addParameter(int parameter,
java.lang.String value)
Adds a string parameter to the PCFMessage. |
void |
addParameter(int parameter,
java.lang.String[] values)
Adds a string list parameter to the PCFMessage. |
void |
addParameter(PCFParameter parameter)
Adds a PCFParameter to the PCFMessage. |
int |
getCommand()
Returns the PCF command identifier |
int |
getCompCode()
Returns the completion code in the MQCFH. |
int |
getControl()
Returns the PCF header control indicator. |
int[] |
getIntListParameterValue(int parameter)
Returns the value of the specified integer list parameter (MQCFIL) as an array of integers. |
int |
getIntParameterValue(int parameter)
Returns the value of the specified integer parameter (MQCFIN) as an integer. |
int |
getMsgSeqNumber()
Returns the PCF message sequence number |
int |
getParameterCount()
Returns the number of parameter structures in the PCF message. |
java.util.Enumeration |
getParameters()
Returns an enumeration of the parameters in the PCFMessage. |
java.lang.Object |
getParameterValue(int parameter)
Returns the value of the specified parameter, or null if the parameter is not found. |
int |
getReason()
Returns the reason code in the MQCFH. |
java.lang.String[] |
getStringListParameterValue(int parameter)
Returns the value of the specified string list parameter (MQCFSL) as an array of strings. |
java.lang.String |
getStringParameterValue(int parameter)
Returns the value of the specified string parameter (MQCFST) as a string. |
void |
initialize(int command)
Initializes a PCFMessage for re-use with the specified command identifier and no parameters. |
void |
initialize(int type,
int command,
int msgSeqNumber,
boolean last)
Initializes a PCFMessage for re-use with the specified type, command identifier, sequence number, control indicator and no parameters. |
void |
initialize(com.ibm.mq.MQMessage message)
Initializes the contents of a PCFHeader by reading from an MQMessage. |
int |
size()
Returns the size in bytes of a PCFHeader |
java.lang.String |
toString()
|
int |
write(com.ibm.mq.MQMessage message)
Writes the contents of a PCFHeader to an MQMessage. |
Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait |
Field Detail |
public static final java.lang.String copyright
Constructor Detail |
public PCFMessage(int command)
command
- the PCF command identifierpublic PCFMessage(int type, int command, int msgSeqNumber, boolean last)
Most applications will not need to use this constructor. PCF request messages, which always have type MQCFT_COMMAND, sequence number 1 and control indicator set to MQCFC_LAST, are more easily constructed using the PCFMessage(int command) form instead.
type
- the PCF message typecommand
- the PCF command identifiermsgSeqNumber
- the sequence number of the messagelast
- if set, indicates this message is the last in a sequencepublic PCFMessage(com.ibm.mq.MQMessage message) throws com.ibm.mq.MQException, java.io.IOException
message
- the message to read fromcom.ibm.mq.MQException
- if the message contents do not yield a valid PCFMessagejava.io.IOException
- if there is a problem reading the messageMethod Detail |
public void initialize(int command)
command
- the PCF command identifierpublic void initialize(int type, int command, int msgSeqNumber, boolean last)
Most applications will not need to use this method. PCF request messages, which always have type MQCFT_COMMAND, sequence number 1 and control indicator set to MQCFC_LAST, can more easily be initialized using the initialize(int command) form instead.
type
- the PCF message typecommand
- the PCF command identifiermsgSeqNumber
- the sequence number of the messagelast
- if set, indicates this message is the last in a sequencepublic void addParameter(PCFParameter parameter)
the
- parameter structure to add (MQCFIN, MQCFIL, MQCFST or MQCFSL)public void addParameter(int parameter, int value)
parameter
- the integer parameter identifiervalue
- the integer valuepublic void addParameter(int parameter, int[] values)
parameter
- the integer list parameter identifiervalue
- the array of integer valuespublic void addParameter(int parameter, java.lang.String value)
parameter
- the string parameter identifiervalue
- the string valuepublic void addParameter(int parameter, java.lang.String[] values)
parameter
- the string list parameter identifiervalue
- the array of string valuespublic int getCommand()
public int getMsgSeqNumber()
public int getControl()
public int getCompCode()
public int getReason()
public int getParameterCount()
public java.util.Enumeration getParameters()
public java.lang.Object getParameterValue(int parameter)
public int getIntParameterValue(int parameter) throws PCFException
parameter
- the integer parameter identifierPCFException
- if the specified parameter does not exist in
the message (the reason code given is MQRCCF_CFIN_PARM_ID_ERROR)public int[] getIntListParameterValue(int parameter) throws PCFException
parameter
- the integer list parameter identifierPCFException
- if the specified parameter does not exist in
the message (the reason code given is MQRCCF_CFIL_PARM_ID_ERROR)public java.lang.String getStringParameterValue(int parameter) throws PCFException
parameter
- the string parameter identifierPCFException
- if the specified parameter does not exist in
the message (the reason code given is MQRCCF_CFST_PARM_ID_ERROR)public java.lang.String[] getStringListParameterValue(int parameter) throws PCFException
parameter
- the string list parameter identifierPCFException
- if the specified parameter does not exist in
the message (the reason code given is MQRC_CFSL_ERROR; no more
specific error code is defined)public void initialize(com.ibm.mq.MQMessage message) throws com.ibm.mq.MQException, java.io.IOException
PCFHeader
initialize
in class PCFHeader
com.ibm.mq.pcf.PCFHeader
message
- the message to read fromcom.ibm.mq.MQException
- if the message does contain
appropriate data for the headerjava.io.IOException
- if there is a problem reading the messagepublic int write(com.ibm.mq.MQMessage message) throws java.io.IOException
PCFHeader
write
in class PCFHeader
com.ibm.mq.pcf.PCFHeader
message
- the message to write tojava.io.IOException
- if there is a problem writing the messagepublic int size()
PCFHeader
size
in class PCFHeader
public java.lang.String toString()
toString
in class java.lang.Object
|
||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||
SUMMARY: INNER | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |