com.ibm.mq.pcf
Class MQCFST

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

public class MQCFST
extends PCFParameter

A class encapsulating the MQCFST (PCF single string parameter) structure.

New in version 2.0:

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

Field Summary
 int codedCharSetId
           
static java.lang.String copyright
           
 int parameter
           
 java.lang.String string
           
 int stringLength
           
 int strucLength
           
static int type
           
 
Constructor Summary
MQCFST()
          Default constructor.
MQCFST(int parameter, java.lang.String string)
          Initializes an MQCFST with the specified values.
MQCFST(com.ibm.mq.MQMessage message)
          Initializes a new MQCFST instance by reading from an MQMessage.
 
Method Summary
 int getParameter()
          Returns the parameter identifier of this PCF parameter structure.
 java.lang.String getStringValue()
          Returns the PCF string parameter value.
 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 MQCFST by reading from an MQMessage.
 void setString(java.lang.String string)
          Sets the MQCFST string value in the string field, also updating the strucLength and stringLength fields.
 void setValue(java.lang.Object value)
          Sets the value of this PCFParameter structure.
 int size()
          Returns the size in bytes of this MQCFST (this will vary depending upon the string length).
 java.lang.String toString()
           
 int write(com.ibm.mq.MQMessage message)
          Writes the contents of an MQCFST to an MQMessage.
static int write(com.ibm.mq.MQMessage message, int parameter, java.lang.String string)
          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 int strucLength

parameter

public int parameter

codedCharSetId

public int codedCharSetId

stringLength

public int stringLength

string

public java.lang.String string
Constructor Detail

MQCFST

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

MQCFST

public MQCFST(int parameter,
              java.lang.String string)
Initializes an MQCFST with the specified values.
Parameters:
parameter - the parameter identifier
value - the string parameter value
See Also:
CMQCFC

MQCFST

public MQCFST(com.ibm.mq.MQMessage message)
       throws com.ibm.mq.MQException,
              java.io.IOException
Initializes a new MQCFST 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 MQCFST 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,
                        java.lang.String string)
                 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
string - the string 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 MQCFST 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 MQCFST structure:
  • if the type field is invalid, the reason code is MQRCCF_STRUCTURE_TYPE_ERROR
  • if the stringLength field is invalid, the reason code is MQRCCF_CFST_STRING_LENGTH_ERR
  • if the strucLength field is invalid, the reason code is MQRCCF_CFST_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 an MQCFST 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 MQCFST (this will vary depending upon the string 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 MQCFST, this is a String.
Overrides:
getValue in class PCFParameter

getStringValue

public java.lang.String getStringValue()
Returns the PCF string parameter value.
Overrides:
getStringValue in class PCFParameter

setValue

public void setValue(java.lang.Object value)
              throws java.lang.ClassCastException
Sets the value of this PCFParameter structure. For an MQCFST, the value is a string (type String). The strucLength, stringLength and string fields are updated from the value parameter.
Overrides:
setValue in class PCFParameter
Parameters:
value - the string list value

setString

public void setString(java.lang.String string)
Sets the MQCFST string value in the string field, also updating the strucLength and stringLength fields.
Parameters:
string - the string value

toString

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