com.ibm.mq.pcf
Class MQCFIN

java.lang.Object
  |
  +--com.ibm.mq.pcf.PCFHeader
        |
        +--com.ibm.mq.pcf.PCFParameter
              |
              +--com.ibm.mq.pcf.MQCFIN
All Implemented Interfaces:
java.io.Serializable

public class MQCFIN
extends PCFParameter

A class encapsulating the MQCFIN (PCF single integer parameter) structure.

New in version 2.0:

Version:
2.2
Author:
Chris Markes
See Also:
Serialized Form

Field Summary
static java.lang.String copyright
           
 int parameter
           
static int strucLength
           
static int type
           
 int value
           
 
Constructor Summary
MQCFIN()
          Default constructor.
MQCFIN(int parameter, int value)
          Initializes an MQCFIN header with the specified values.
MQCFIN(com.ibm.mq.MQMessage message)
          Initializes a new MQCFIN instance by reading from an MQMessage.
 
Method Summary
 int getParameter()
          Returns the parameter identifier of this PCF parameter structure.
 java.lang.String getStringValue()
          Returns a string representing the integer value if this PCF parameter structure.
 int getType()
          Returns the type identifier of this PCF parameter structure.
 java.lang.Object getValue()
          Returns the value of this PCF parameter structure.
 void initialize(com.ibm.mq.MQMessage message)
          Initializes the contents of an MQCFIN by reading from an MQMessage.
 void setValue(int value)
          Sets the MQCFIN integer value in the value field.
 void setValue(java.lang.Integer value)
          Sets the MQCFIN integer value in the value field.
 void setValue(java.lang.Object value)
          Sets the value of this PCF parameter structure.
 int size()
          Returns the size in bytes of this MQCFIN (this will always be MQCFIN_STRUC_LENGTH).
 java.lang.String toString()
           
 int write(com.ibm.mq.MQMessage message)
          Writes the contents of this MQCFIN to an MQMessage.
static int write(com.ibm.mq.MQMessage message, int parameter, int value)
          A convenience method for writing an MQCFIN header structure with the specified values to an MQMessage.
 
Methods inherited from class com.ibm.mq.pcf.PCFParameter
nextParameter
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Field Detail

copyright

public static final java.lang.String copyright

type

public static final int type

strucLength

public static final int strucLength

parameter

public int parameter

value

public int value
Constructor Detail

MQCFIN

public MQCFIN()
Default constructor. Initializes an MQCFIN header with

MQCFIN

public MQCFIN(int parameter,
              int value)
Initializes an MQCFIN header with the specified values.
Parameters:
parameter - the parameter identifier
value - the integer parameter value
See Also:
CMQCFC

MQCFIN

public MQCFIN(com.ibm.mq.MQMessage message)
       throws com.ibm.mq.MQException,
              java.io.IOException
Initializes a new MQCFIN instance by reading from an MQMessage.
Parameters:
message - the message to read from
Throws:
com.ibm.mq.MQException - if the message contents do not yield a valid MQCFIN structure
java.io.IOException - if there is a problem reading the message
Method Detail

write

public static int write(com.ibm.mq.MQMessage message,
                        int parameter,
                        int value)
                 throws java.io.IOException
A convenience method for writing an MQCFIN header structure with the specified values to an MQMessage.
Parameters:
message - the message to write to
parameter - the parameter identifier
value - the integer parameter value
Throws:
java.io.IOException - if there is a problem writing the message
See Also:
CMQCFC

initialize

public void initialize(com.ibm.mq.MQMessage message)
                throws com.ibm.mq.MQException,
                       java.io.IOException
Initializes the contents of an MQCFIN by reading from an MQMessage.
Overrides:
initialize in class PCFHeader
Parameters:
message - the message to read from
Throws:
com.ibm.mq.MQException - if the message contents do not yield a valid MQCFIN structure:
  • if the type field is invalid, the reason code is MQRCCF_STRUCTURE_TYPE_ERROR
  • if the strucLength field is invalid, the reason code is MQRCCF_CFIN_LENGTH_ERROR
java.io.IOException - if there is a problem reading the message

write

public int write(com.ibm.mq.MQMessage message)
          throws java.io.IOException
Writes the contents of this MQCFIN to an MQMessage.
Overrides:
write in class PCFHeader
Parameters:
message - the message to write to
Throws:
java.io.IOException - if there is a problem writing the message

size

public int size()
Returns the size in bytes of this MQCFIN (this will always be MQCFIN_STRUC_LENGTH).
Overrides:
size in class PCFHeader

getType

public int getType()
Returns the type identifier of this PCF parameter structure.
Overrides:
getType in class PCFParameter

getParameter

public int getParameter()
Returns the parameter identifier of this PCF parameter structure.
Overrides:
getParameter in class PCFParameter

getValue

public java.lang.Object getValue()
Returns the value of this PCF parameter structure. For an MQCFIN, this is an Integer.
Overrides:
getValue in class PCFParameter

getStringValue

public java.lang.String getStringValue()
Returns a string representing the integer value if this PCF parameter structure.
Overrides:
getStringValue in class PCFParameter

setValue

public void setValue(java.lang.Object value)
              throws java.lang.ClassCastException
Sets the value of this PCF parameter structure. For an MQCFIN, this is an integer (type Integer).
Overrides:
setValue in class PCFParameter

setValue

public void setValue(int value)
Sets the MQCFIN integer value in the value field.
Parameters:
value - the integer value as an integer primitive

setValue

public void setValue(java.lang.Integer value)
Sets the MQCFIN integer value in the value field.
Parameters:
value - the integer value as an Integer object

toString

public java.lang.String toString()
Overrides:
toString in class java.lang.Object