com.ibm.mq.headers.pcf
Class MQCFGR
- 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.PCFParameter
-
- com.ibm.mq.headers.pcf.MQCFGR
-
- All Implemented Interfaces:
- MQData, MQHeader, PCFContent
public class MQCFGR extends PCFParameter implements PCFContent
MQCFGR (PCF group parameter) header class.struct tagMQCFGR { MQLONG Type; // Structure type MQLONG StrucLength; // Structure length MQLONG Parameter; // Parameter identifier MQLONG ParameterCount; // Count of group parameter structures };
-
-
Nested Class Summary
-
Nested classes/interfaces inherited from interface com.ibm.mq.headers.MQHeader
MQHeader.Field
-
-
Field Summary
-
Constructor Summary
Constructors Constructor and Description MQCFGR()Constructs an MQCFGR instance with default field values.MQCFGR(java.io.DataInput message)Constructs an MQCFGR instance populated from an MQMessage.MQCFGR(java.io.DataInput message, int encoding, int characterSet)Constructs an MQCFGR instance populated from a DataInput source.
-
Method Summary
All Methods Static Methods Instance Methods Concrete Methods Modifier and Type Method and Description voidaddFilterParameter(int parameter, int operator, byte[] value)Adds a bytes string filter parameter to the group.voidaddFilterParameter(int parameter, int operator, int value)Adds an integer filter parameter to the group.voidaddFilterParameter(int parameter, int operator, java.lang.String value)Adds a string filter parameter to the group.voidaddParameter(int parameter, byte[] value)Adds a byte array parameter to the group.voidaddParameter(int parameter, int value)Adds an integer parameter to the group.voidaddParameter(int parameter, int[] values)Adds an integer list parameter to the group.voidaddParameter(int parameter, long value)Adds a 64-bit integer parameter to the group.voidaddParameter(int parameter, long[] values)Adds a 64-bit integer list parameter to the group.voidaddParameter(int parameter, java.lang.String value)Adds a string parameter to the group.voidaddParameter(int parameter, java.lang.String[] values)Adds a string list parameter to the group.voidaddParameter(PCFParameter parameter)Adds a PCFParameter to the group.booleanequals(java.lang.Object obj)Returns true when invoked with another MQCFGR instance with the same parameter, parameterCount, and parameter children.byte[]getBytesParameterValue(int parameter)Returns the value of the specified byte array parameter (MQCFBS).intgetHeaderVersion()gets the version number of the header formatlonggetInt64ParameterValue(int parameter)Returns the value of the specified integer parameter (MQCFIN64) as an integer.long[]getIntList64ParameterValue(int parameter)Returns the value of the specified integer list parameter (MQCFIL64) as an array of integers.int[]getIntListParameterValue(int parameter)Returns the value of the specified integer list parameter (MQCFIL) as an array of integers.intgetIntParameterValue(int parameter)Returns the value of the specified integer parameter (MQCFIN) as an integer.intgetParameter()gets the parameter identifierPCFParametergetParameter(int parameter)Returns the PCFParameter structure for the specified parameter, or null if the parameter is not found.intgetParameterCount()gets the count of group parameter structuresjava.util.EnumerationgetParameters()Returns an enumeration of the parameters in the group.java.lang.ObjectgetParameterValue(int parameter)Returns the value of the specified parameter, or null if the parameter is not found.java.lang.String[]getStringListParameterValue(int parameter)Returns the value of the specified string list parameter (MQCFSL) as an array of strings.java.lang.StringgetStringParameterValue(int parameter)Returns the value of the specified string parameter (MQCFST) as a string.intgetStrucLength()Get the length of the structure.intgetType()gets the structure typejava.lang.ObjectgetValue()gets the parameter valueinthashCode()Returns a hash code value for the objectintread(java.io.DataInput message, int encoding, int characterSet)Reads content from a message or byte stream.voidsetParameter(int value)sets the parameter identifierintsetParameterCount(int value)Sets the MQCFGR parameter count.java.lang.StringtoString()intwrite(java.io.DataOutput messageP, int encoding, int characterSet)Writes the content of this data element to a message or byte stream.static intwrite(java.lang.Object message, int parameter, int parameterCount)A convenience method for writing an MQCFGR header structure with the specified values to an MQMessage.-
Methods inherited from class com.ibm.mq.headers.pcf.PCFParameter
getParameterName, getStringValue, nextParameter
-
Methods inherited from class com.ibm.mq.headers.internal.Header
characterSet, encoding, fields, getBytesValue, getCharValue, getCharValue, getIntValue, getJmqiEnv, getStringValue, getValue, headerType, read, read, setBytesValue, setCharValue, setCharValue, setIntValue, setStringValue, setValue, size, store, store, type, validate, write
-
-
-
-
Constructor Detail
-
MQCFGR
public MQCFGR()
Constructs an MQCFGR instance with default field values.
-
MQCFGR
public MQCFGR(java.io.DataInput message) throws MQDataException, java.io.IOExceptionConstructs an MQCFGR instance populated from an MQMessage.- Parameters:
message- the message to read- Throws:
MQDataException- if the message content does not yield a valid MQCFGR stucturejava.io.IOException- if there is a problem reading the message content
-
MQCFGR
public MQCFGR(java.io.DataInput message, int encoding, int characterSet) throws MQDataException, java.io.IOExceptionConstructs an MQCFGR 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 MQCFGR stucturejava.io.IOException- if there is a problem reading the message content
-
-
Method Detail
-
write
public static int write(java.lang.Object message, int parameter, int parameterCount) throws java.io.IOExceptionA convenience method for writing an MQCFGR header structure with the specified values to an MQMessage.- Parameters:
message- the message to write toparameter- the parameter identifierparameterCount- the number of parameter structures enclosed by the group- Returns:
- the number of bytes written
- Throws:
java.io.IOException- if there is a problem writing the message
-
read
public int read(java.io.DataInput message, int encoding, int characterSet) throws MQDataException, java.io.IOExceptionDescription copied from interface:MQDataReads content from a message or byte stream. The content is interpreted (if applicable) using the specified encoding and CCSID.- Specified by:
readin interfaceMQData- Overrides:
readin classcom.ibm.mq.headers.internal.Header- Parameters:
message- the message.encoding- the numeric encoding. see (CMQC.MQENC_* for values).characterSet- the Coded Character Set Identifier.- Returns:
- the number of bytes consumed.
- Throws:
MQDataExceptionjava.io.IOException- See Also:
Header.read(java.io.DataInput, int, int)
-
write
public int write(java.io.DataOutput messageP, int encoding, int characterSet) throws java.io.IOExceptionDescription copied from interface:MQDataWrites the content of this data element to a message or byte stream. The content is encoded (if applicable) using the specified encoding and CCSID.- Specified by:
writein interfaceMQData- Overrides:
writein classcom.ibm.mq.headers.internal.Header- Parameters:
messageP- the message.encoding- the numeric encoding. see (CMQC.MQENC_* for values)._characterSet- the Coded Character Set Identifier.- Returns:
- the number of bytes written
- Throws:
java.io.IOException- See Also:
MQData.write(java.io.DataOutput, int, int)
-
getType
public int getType()
gets the structure type
-
getStrucLength
public int getStrucLength()
Get the length of the structure.- Returns:
- the structure length.
-
getParameter
public int getParameter()
gets the parameter identifier- Specified by:
getParameterin classPCFParameter- Returns:
- the parameter identifier
-
setParameter
public void setParameter(int value)
sets the parameter identifier- Parameters:
value- the parameter identifier
-
getParameterCount
public int getParameterCount()
gets the count of group parameter structures- Specified by:
getParameterCountin interfacePCFContent- Returns:
- the count of group parameter structures
-
setParameterCount
public int setParameterCount(int value)
Sets the MQCFGR parameter count. This has the effect of trimming the size of the child PCFParameter collection to the number specified. If the argument is zero, the effect is to clear all child parameters. Specifying a value larger than the current parameter count has no effect. Negative values are ignored.- Parameters:
value- the integer value as an Integer object- Returns:
- the new parameter Count
-
getValue
public java.lang.Object getValue()
Description copied from class:PCFParametergets the parameter value- Specified by:
getValuein classPCFParameter- Returns:
- the parameter value
- See Also:
PCFParameter.getValue()
-
addParameter
public void addParameter(PCFParameter parameter)
Description copied from interface:PCFContentAdds a PCFParameter to the group.- Specified by:
addParameterin 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)Description copied from interface:PCFContentAdds an integer parameter to the group.- Specified by:
addParameterin interfacePCFContent- Parameters:
parameter- the integer parameter identifiervalue- the integer value- See Also:
PCFContent.addParameter(int, int)
-
addParameter
public void addParameter(int parameter, int[] values)Description copied from interface:PCFContentAdds an integer list parameter to the group.- Specified by:
addParameterin 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)Description copied from interface:PCFContentAdds a 64-bit integer parameter to the group.- Specified by:
addParameterin interfacePCFContent- Parameters:
parameter- the integer parameter identifiervalue- the integer value- See Also:
PCFContent.addParameter(int, long)
-
addParameter
public void addParameter(int parameter, long[] values)Description copied from interface:PCFContentAdds a 64-bit integer list parameter to the group.- Specified by:
addParameterin 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)Description copied from interface:PCFContentAdds a string parameter to the group.- Specified by:
addParameterin 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)Description copied from interface:PCFContentAdds a string list parameter to the group.- Specified by:
addParameterin 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)Description copied from interface:PCFContentAdds a byte array parameter to the group.- Specified by:
addParameterin 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)Description copied from interface:PCFContentAdds an integer filter parameter to the group.- Specified by:
addFilterParameterin 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)Description copied from interface:PCFContentAdds a string filter parameter to the group.- Specified by:
addFilterParameterin 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)Description copied from interface:PCFContentAdds a bytes string filter parameter to the group.- Specified by:
addFilterParameterin interfacePCFContent- Parameters:
parameter- the filter parameter identifieroperator- one of the MQCFOP_* filter operator constantsvalue- the filter value- See Also:
PCFContent.addFilterParameter(int, int, byte[])
-
getParameters
public java.util.Enumeration getParameters()
Description copied from interface:PCFContentReturns 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:
getParametersin interfacePCFContent- Returns:
- an enumeration of parameters
- See Also:
PCFContent.getParameters()
-
getParameter
public PCFParameter getParameter(int parameter)
Description copied from interface:PCFContentReturns the PCFParameter structure for the specified parameter, or null if the parameter is not found.- Specified by:
getParameterin interfacePCFContent- Returns:
- the specified parameter object
- See Also:
PCFContent.getParameter(int)
-
getParameterValue
public java.lang.Object getParameterValue(int parameter)
Description copied from interface:PCFContentReturns 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:
getParameterValuein interfacePCFContent- Returns:
- the specified parameter value
- See Also:
PCFContent.getParameterValue(int)
-
getIntParameterValue
public int getIntParameterValue(int parameter) throws PCFExceptionDescription copied from interface:PCFContentReturns the value of the specified integer parameter (MQCFIN) as an integer.- Specified by:
getIntParameterValuein 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 PCFExceptionDescription copied from interface:PCFContentReturns the value of the specified integer list parameter (MQCFIL) as an array of integers.- Specified by:
getIntListParameterValuein 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 PCFExceptionDescription copied from interface:PCFContentReturns the value of the specified integer parameter (MQCFIN64) as an integer.- Specified by:
getInt64ParameterValuein 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 PCFExceptionDescription copied from interface:PCFContentReturns the value of the specified integer list parameter (MQCFIL64) as an array of integers.- Specified by:
getIntList64ParameterValuein 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 PCFExceptionDescription copied from interface:PCFContentReturns the value of the specified string parameter (MQCFST) as a string.- Specified by:
getStringParameterValuein 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 PCFExceptionDescription copied from interface:PCFContentReturns the value of the specified string list parameter (MQCFSL) as an array of strings.- Specified by:
getStringListParameterValuein 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 PCFExceptionDescription copied from interface:PCFContentReturns the value of the specified byte array parameter (MQCFBS).- Specified by:
getBytesParameterValuein 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)
-
equals
public boolean equals(java.lang.Object obj)
Returns true when invoked with another MQCFGR instance with the same parameter, parameterCount, and parameter children.- Overrides:
equalsin classPCFParameter- Parameters:
obj-- Returns:
- true of the object equals this one
-
hashCode
public int hashCode()
Description copied from class:PCFParameterReturns a hash code value for the object- Specified by:
hashCodein classPCFParameter- Returns:
- a hash code value for this object.
- See Also:
PCFParameter.hashCode()
-
getHeaderVersion
public int getHeaderVersion()
Description copied from class:PCFParametergets the version number of the header format- Overrides:
getHeaderVersionin classPCFParameter- Returns:
- the version number of the header format
- See Also:
PCFParameter.getHeaderVersion()
-
toString
public java.lang.String toString()
- Overrides:
toStringin classcom.ibm.mq.headers.internal.Header- See Also:
Header.toString()
-
-