com.ibm.mq.pcf
Class PCFMessage
- java.lang.Object
-
- com.ibm.mq.jmqi.JmqiObject
-
- com.ibm.mq.headers.internal.Header
-
- com.ibm.mq.pcf.PCFHeader
-
- com.ibm.mq.pcf.PCFMessage
-
- All Implemented Interfaces:
- com.ibm.mq.headers.internal.CachingHeader, MQData, MQHeader, PCFContent
Deprecated.usePCFMessage
instead.
public class PCFMessage extends PCFHeader implements PCFContent
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 and so on). A PCFMessage instance can be constructed and manipulated without direct reference to the PCF header and parameter structures themselves.- See Also:
PCFMessageAgent
-
-
Nested Class Summary
-
Nested classes/interfaces inherited from interface com.ibm.mq.headers.MQHeader
MQHeader.Field
-
-
Constructor Summary
Constructors Constructor and Description PCFMessage(int command)
Deprecated.Initializes a PCFMessage as a PCF request with the specified MQCFH command identifier.PCFMessage(int type, int command, int msgSeqNumber, boolean last)
Deprecated.Initializes a PCFMessage with the specified MQCFH type, command identifier, sequence number and control indicator.PCFMessage(MQMessage message)
Deprecated.Initializes a PCFMessage from the contents of an MQMessage.
-
Method Summary
All Methods Instance Methods Concrete Methods Deprecated Methods Modifier and Type Method and Description void
addFilterParameter(int parameter, int operator, byte[] value)
Deprecated.Adds a bytes string filter parameter to the group.void
addFilterParameter(int parameter, int operator, int value)
Deprecated.Adds an integer filter parameter to the group.void
addFilterParameter(int parameter, int operator, java.lang.String value)
Deprecated.Adds a string filter parameter to the group.void
addParameter(int parameter, byte[] value)
Deprecated.Adds a byte array parameter to the group.void
addParameter(int parameter, int value)
Deprecated.Adds an integer parameter to the group.void
addParameter(int parameter, int[] values)
Deprecated.Adds an integer list parameter to the group.void
addParameter(int parameter, long value)
Deprecated.Adds a 64-bit integer parameter to the group.void
addParameter(int parameter, long[] values)
Deprecated.Adds a 64-bit integer list parameter to the group.void
addParameter(int parameter, java.lang.String value)
Deprecated.Adds a string parameter to the group.void
addParameter(int parameter, java.lang.String[] values)
Deprecated.Adds a string list parameter to the group.void
addParameter(PCFParameter parameter)
Deprecated.Adds a PCFParameter to the PCFMessage.boolean
equals(java.lang.Object obj)
Deprecated.Returns true when invoked with another PCFMessage instance with matching header and equivalent parameters in the same order.byte[]
getBytesParameterValue(int parameter)
Deprecated.Returns the value of the specified byte array parameter (MQCFBS).int
getCommand()
Deprecated.Returns the PCF command identifierint
getCompCode()
Deprecated.Returns the completion code in the MQCFH.int
getControl()
Deprecated.Returns the PCF header control indicator.long
getInt64ParameterValue(int parameter)
Deprecated.Returns the value of the specified integer parameter (MQCFIN64) as an integer.long[]
getIntList64ParameterValue(int parameter)
Deprecated.Returns the value of the specified integer list parameter (MQCFIL64) as an array of integers.int[]
getIntListParameterValue(int parameter)
Deprecated.Returns the value of the specified integer list parameter (MQCFIL) as an array of integers.int
getIntParameterValue(int parameter)
Deprecated.Returns the value of the specified integer parameter (MQCFIN) as an integer.int
getMsgSeqNumber()
Deprecated.Returns the PCF message sequence numberPCFParameter
getParameter(int parameter)
Deprecated.Returns the PCFParameter structure for the specified parameter, or null if the parameter is not found.int
getParameterCount()
Deprecated.Returns the number of parameter structures in the PCF message.java.util.Enumeration
getParameters()
Deprecated.Returns an enumeration of the parameters in the group.java.lang.Object
getParameterValue(int parameter)
Deprecated.Returns the value of the specified parameter, or null if the parameter is not found.int
getReason()
Deprecated.Returns the reason code in the MQCFH.java.lang.String[]
getStringListParameterValue(int parameter)
Deprecated.Returns the value of the specified string list parameter (MQCFSL) as an array of strings.java.lang.String
getStringParameterValue(int parameter)
Deprecated.Returns the value of the specified string parameter (MQCFST) as a string.int
getType()
Deprecated.Returns the PCF type identifiervoid
initialize(int command)
Deprecated.Initializes a PCFMessage for re-use with the specified command identifier and no parameters.void
initialize(int type, int command, int msgSeqNumber, boolean last)
Deprecated.Initializes a PCFMessage for re-use with the specified type, command identifier, sequence number, control indicator and no parameters.void
initialize(MQMessage message)
Deprecated.Reads the content of a PCFMessage from an MQMessage.int
size()
Deprecated.Returns the size of this PCFMessage in bytes.java.lang.String
toString()
Deprecated.Returns a string representation of the members of the class instanceint
write(java.io.DataOutput message)
Deprecated.Writes the content of this PCFMessage to an DataOutput.int
write(MQMessage message)
Deprecated.Writes the content of this PCFMessage to an MQMessage.-
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, type, validate
-
-
-
-
Constructor Detail
-
PCFMessage
public PCFMessage(int command)
Deprecated.Initializes a PCFMessage as a PCF request with the specified MQCFH command identifier. The parameter count is incremented from zero as parameters are added.- Parameters:
command
- the PCF command identifier
-
PCFMessage
public PCFMessage(int type, int command, int msgSeqNumber, boolean last)
Deprecated.Initializes a PCFMessage with the specified MQCFH type, command identifier, sequence number and control indicator. The parameter count is incremented from zero as parameters are added. 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.- Parameters:
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 sequence
-
PCFMessage
public PCFMessage(MQMessage message) throws MQException, java.io.IOException
Deprecated.Initializes a PCFMessage from the contents of an MQMessage.- Parameters:
message
- the message to read from- Throws:
MQException
- if the message contents do not yield a valid PCFMessagejava.io.IOException
- if there is a problem reading the message
-
-
Method Detail
-
initialize
public void initialize(int command)
Deprecated.Initializes a PCFMessage for re-use with the specified command identifier and no parameters.- Parameters:
command
- the PCF command identifier
-
initialize
public void initialize(int type, int command, int msgSeqNumber, boolean last)
Deprecated.Initializes a PCFMessage for re-use with the specified type, command identifier, sequence number, control indicator and no parameters. 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.- Parameters:
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 sequence
-
addParameter
public void addParameter(PCFParameter parameter)
Deprecated.Adds a PCFParameter to the PCFMessage. The MQCFH version is updated automatically if necessary to correspond with the parameter type. (For example, the version must be set to MQCFH_VERSION_3 if a PCF filter parameter is added.)- Specified by:
addParameter
in interfacePCFContent
- Parameters:
parameter
- the parameter structure to add (MQCFIN, MQCFIL, MQCFST and so on)- See Also:
PCFContent.addParameter(PCFParameter)
-
addParameter
public void addParameter(int parameter, int value)
Deprecated.Description copied from interface:PCFContent
Adds an integer parameter to the group.- Specified by:
addParameter
in interfacePCFContent
- Parameters:
parameter
- the integer parameter identifiervalue
- the integer value- See Also:
PCFContent.addParameter(int, int)
-
addParameter
public void addParameter(int parameter, int[] values)
Deprecated.Description copied from interface:PCFContent
Adds an integer list parameter to the group.- Specified by:
addParameter
in interfacePCFContent
- Parameters:
parameter
- the integer list parameter identifiervalues
- the array of integer values- See Also:
PCFContent.addParameter(int, int[])
-
addParameter
public void addParameter(int parameter, long value)
Deprecated.Description copied from interface:PCFContent
Adds a 64-bit integer parameter to the group.- Specified by:
addParameter
in interfacePCFContent
- Parameters:
parameter
- the integer parameter identifiervalue
- the integer value- See Also:
PCFContent.addParameter(int, long)
-
addParameter
public void addParameter(int parameter, long[] values)
Deprecated.Description copied from interface:PCFContent
Adds a 64-bit integer list parameter to the group.- Specified by:
addParameter
in interfacePCFContent
- Parameters:
parameter
- the integer list parameter identifiervalues
- the array of integer values- See Also:
PCFContent.addParameter(int, long[])
-
addParameter
public void addParameter(int parameter, java.lang.String value)
Deprecated.Description copied from interface:PCFContent
Adds a string parameter to the group.- Specified by:
addParameter
in interfacePCFContent
- Parameters:
parameter
- the string parameter identifiervalue
- the string value- See Also:
PCFContent.addParameter(int, String)
-
addParameter
public void addParameter(int parameter, java.lang.String[] values)
Deprecated.Description copied from interface:PCFContent
Adds a string list parameter to the group.- Specified by:
addParameter
in interfacePCFContent
- Parameters:
parameter
- the string list parameter identifiervalues
- the array of string values- See Also:
PCFContent.addParameter(int, String[])
-
addParameter
public void addParameter(int parameter, byte[] value)
Deprecated.Description copied from interface:PCFContent
Adds a byte array parameter to the group.- Specified by:
addParameter
in interfacePCFContent
- Parameters:
parameter
- the string list parameter identifiervalue
- the array of string values- See Also:
PCFContent.addParameter(int, byte[])
-
addFilterParameter
public void addFilterParameter(int parameter, int operator, int value)
Deprecated.Description copied from interface:PCFContent
Adds an integer filter parameter to the group.- Specified by:
addFilterParameter
in interfacePCFContent
- Parameters:
parameter
- the filter parameter identifieroperator
- one of the MQCFOP_* filter operator constantsvalue
- the filter value- See Also:
PCFContent.addFilterParameter(int, int, int)
-
addFilterParameter
public void addFilterParameter(int parameter, int operator, java.lang.String value)
Deprecated.Description copied from interface:PCFContent
Adds a string filter parameter to the group.- Specified by:
addFilterParameter
in interfacePCFContent
- Parameters:
parameter
- the filter parameter identifieroperator
- one of the MQCFOP_* filter operator constantsvalue
- the filter value- See Also:
PCFContent.addFilterParameter(int, int, String)
-
addFilterParameter
public void addFilterParameter(int parameter, int operator, byte[] value)
Deprecated.Description copied from interface:PCFContent
Adds a bytes string filter parameter to the group.- Specified by:
addFilterParameter
in interfacePCFContent
- Parameters:
parameter
- the filter parameter identifieroperator
- one of the MQCFOP_* filter operator constantsvalue
- the filter value- See Also:
PCFContent.addFilterParameter(int, int, byte[])
-
getType
public int getType()
Deprecated.Returns the PCF type identifier
-
getCommand
public int getCommand()
Deprecated.Returns the PCF command identifier- Returns:
- the value of the command field from the MQCFH
-
getMsgSeqNumber
public int getMsgSeqNumber()
Deprecated.Returns the PCF message sequence number- Returns:
- the value of the msgSeqNumber field from the MQCFH
-
getControl
public int getControl()
Deprecated.Returns the PCF header control indicator.- Returns:
- the value of the control field from the MQCFH
-
getCompCode
public int getCompCode()
Deprecated.Returns the completion code in the MQCFH.- Returns:
- the value of the compCode field from the MQCFH
-
getReason
public int getReason()
Deprecated.Returns the reason code in the MQCFH.- Returns:
- the value of the reason field from the MQCFH
-
getParameterCount
public int getParameterCount()
Deprecated.Returns the number of parameter structures in the PCF message.- Specified by:
getParameterCount
in interfacePCFContent
- Returns:
- the value of the parameterCount field from the MQCFH
- See Also:
PCFContent.getParameterCount()
-
getParameters
public java.util.Enumeration getParameters()
Deprecated.Description copied from interface:PCFContent
Returns an enumeration of the parameters in the group. The elements of the Enumeration returned are individual PCFParameter instances (instances of MQCFIN, MQCFIL, MQCFST or MQCFSL etc.).- Specified by:
getParameters
in interfacePCFContent
- Returns:
- the PCF message parameter structures
- See Also:
PCFContent.getParameters()
-
getParameter
public PCFParameter getParameter(int parameter)
Deprecated.Description copied from interface:PCFContent
Returns the PCFParameter structure for the specified parameter, or null if the parameter is not found.- Specified by:
getParameter
in interfacePCFContent
- Returns:
- the specified parameter object
- See Also:
PCFContent.getParameter(int)
-
getParameterValue
public java.lang.Object getParameterValue(int parameter)
Deprecated.Description copied from interface:PCFContent
Returns the value of the specified parameter, or null if the parameter is not found. The object returned is a single Integer, a single String, an array of integers or array of Strings depending on the type of PCFParameter. The caller can infer the expected return type from the supplied parameter identifier.- Specified by:
getParameterValue
in interfacePCFContent
- Returns:
- the specified parameter value
- See Also:
PCFContent.getParameterValue(int)
-
getIntParameterValue
public int getIntParameterValue(int parameter) throws PCFException
Deprecated.Description copied from interface:PCFContent
Returns the value of the specified integer parameter (MQCFIN) as an integer.- Specified by:
getIntParameterValue
in interfacePCFContent
- Parameters:
parameter
- the integer parameter identifier- Returns:
- the integer parameter value
- Throws:
PCFException
- if the specified parameter does not exist in the message (the reason code given is MQRCCF_CFIN_PARM_ID_ERROR)- See Also:
PCFContent.getIntParameterValue(int)
-
getIntListParameterValue
public int[] getIntListParameterValue(int parameter) throws PCFException
Deprecated.Description copied from interface:PCFContent
Returns the value of the specified integer list parameter (MQCFIL) as an array of integers.- Specified by:
getIntListParameterValue
in interfacePCFContent
- Parameters:
parameter
- the integer list parameter identifier- Returns:
- the integer list parameter values
- Throws:
PCFException
- if the specified parameter does not exist in the group (the reason code given is MQRCCF_CFIL_PARM_ID_ERROR)- See Also:
PCFContent.getIntListParameterValue(int)
-
getInt64ParameterValue
public long getInt64ParameterValue(int parameter) throws PCFException
Deprecated.Description copied from interface:PCFContent
Returns the value of the specified integer parameter (MQCFIN64) as an integer.- Specified by:
getInt64ParameterValue
in interfacePCFContent
- Parameters:
parameter
- the integer parameter identifier- Returns:
- the integer parameter value
- Throws:
PCFException
- if the specified parameter does not exist in the message (the reason code given is MQRCCF_CFIN_PARM_ID_ERROR)- See Also:
PCFContent.getInt64ParameterValue(int)
-
getIntList64ParameterValue
public long[] getIntList64ParameterValue(int parameter) throws PCFException
Deprecated.Description copied from interface:PCFContent
Returns the value of the specified integer list parameter (MQCFIL64) as an array of integers.- Specified by:
getIntList64ParameterValue
in interfacePCFContent
- Parameters:
parameter
- the integer list parameter identifier- Returns:
- the integer list parameter values
- Throws:
PCFException
- if the specified parameter does not exist in the group (the reason code given is MQRCCF_CFIL_PARM_ID_ERROR)- See Also:
PCFContent.getIntList64ParameterValue(int)
-
getStringParameterValue
public java.lang.String getStringParameterValue(int parameter) throws PCFException
Deprecated.Description copied from interface:PCFContent
Returns the value of the specified string parameter (MQCFST) as a string.- Specified by:
getStringParameterValue
in interfacePCFContent
- Parameters:
parameter
- the string parameter identifier- Returns:
- the string parameter value
- Throws:
PCFException
- if the specified parameter does not exist in the group (the reason code given is MQRCCF_CFST_PARM_ID_ERROR)- See Also:
PCFContent.getStringParameterValue(int)
-
getStringListParameterValue
public java.lang.String[] getStringListParameterValue(int parameter) throws PCFException
Deprecated.Description copied from interface:PCFContent
Returns the value of the specified string list parameter (MQCFSL) as an array of strings.- Specified by:
getStringListParameterValue
in interfacePCFContent
- Parameters:
parameter
- the string list parameter identifier- Returns:
- the string list parameter values
- Throws:
PCFException
- if the specified parameter does not exist in the group (the reason code given is MQRCCF_CFSL_PARM_ID_ERROR; no more specific error code is defined)- See Also:
PCFContent.getStringListParameterValue(int)
-
getBytesParameterValue
public byte[] getBytesParameterValue(int parameter) throws PCFException
Deprecated.Description copied from interface:PCFContent
Returns the value of the specified byte array parameter (MQCFBS).- Specified by:
getBytesParameterValue
in interfacePCFContent
- Parameters:
parameter
- the byte array parameter identifier- Returns:
- the byte array parameter value
- Throws:
PCFException
- if the specified parameter does not exist in the group (the reason code given is MQRCCF_CFBS_PARM_ID_ERROR)- See Also:
PCFContent.getBytesParameterValue(int)
-
initialize
public void initialize(MQMessage message) throws MQException, java.io.IOException
Deprecated.Reads the content of a PCFMessage from an MQMessage.- Overrides:
initialize
in classPCFHeader
- Parameters:
message
- the message.- Throws:
MQException
java.io.IOException
- See Also:
PCFHeader.initialize(MQMessage)
-
write
public int write(MQMessage message) throws java.io.IOException
Deprecated.Writes the content of this PCFMessage to an MQMessage.- Parameters:
message
- The MQMessage to write to- Returns:
- The number of bytes written
- Throws:
java.io.IOException
- If there is an IO error- See Also:
PCFHeader.write(java.io.DataOutput,int,int)
-
write
public int write(java.io.DataOutput message) throws java.io.IOException
Deprecated.Writes the content of this PCFMessage to an DataOutput.- Specified by:
write
in interfaceMQData
- Overrides:
write
in classcom.ibm.mq.headers.internal.Header
- Parameters:
message
- The MQMessage to write to- Returns:
- The number of bytes written
- Throws:
java.io.IOException
- If there is an IO error- See Also:
PCFHeader.write(java.io.DataOutput,int,int)
-
size
public int size()
Deprecated.Returns the size of this PCFMessage in bytes.- Specified by:
size
in interfaceMQData
- Overrides:
size
in classPCFHeader
- Returns:
- the size in bytes occupied by this data element in a message.
- See Also:
PCFHeader.size()
-
equals
public boolean equals(java.lang.Object obj)
Deprecated.Returns true when invoked with another PCFMessage instance with matching header and equivalent parameters in the same order.- Overrides:
equals
in classjava.lang.Object
- Parameters:
obj
-- Returns:
- true of the object equals this one
-
-