com.ibm.mq.pcf
Class MQCFSL

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

public class MQCFSL
extends PCFParameter

A class encapsulating the MQCFSL (PCF string list 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 count
           
 int parameter
           
 int stringLength
           
 java.lang.String[] strings
           
 int strucLength
           
static int type
           
 
Constructor Summary
MQCFSL()
          Default constructor.
MQCFSL(int parameter, java.lang.String[] strings)
          Initializes an MQCFSL with the specified values.
MQCFSL(com.ibm.mq.MQMessage message)
          Initializes a new MQCFSL 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 single string representing the values of this PCF string array structure, one value per line.
 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 MQCFSL by reading from an MQMessage.
 void setStrings(java.lang.String[] strings)
          Sets the MQCFSL string values in the strings field, also updating the strucLength, stringLength, and count fields.
 void setValue(java.lang.Object value)
          Sets the value of this PCFParameter structure.
 int size()
          Returns the size in bytes of this MQCFSL (this will vary depending upon the string length and the size of the string array).
 java.lang.String toString()
           
 int write(com.ibm.mq.MQMessage message)
          Writes the contents of a MQCFH to an MQMessage.
static int write(com.ibm.mq.MQMessage message, int parameter, java.lang.String[] strings)
          A convenience method for writing an MQCFSL header structure with the specified values to a message.
 
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

count

public int count

stringLength

public int stringLength

strings

public java.lang.String[] strings
Constructor Detail

MQCFSL

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

MQCFSL

public MQCFSL(int parameter,
              java.lang.String[] strings)
Initializes an MQCFSL with the specified values.
Parameters:
parameter - the parameter identifier
strings - the set of string values

MQCFSL

public MQCFSL(com.ibm.mq.MQMessage message)
       throws com.ibm.mq.MQException,
              java.io.IOException
Initializes a new MQCFSL 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 MQCFSL 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[] strings)
                 throws java.io.IOException
A convenience method for writing an MQCFSL header structure with the specified values to a message.
Parameters:
message - the message to write to
parameter - the parameter identifier
strings - the set of string values
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 MQCFSL 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 MQCFSL structure:
  • if the type value is invalid, the reason code is MQRCCF_STRUCTURE_TYPE_ERROR
  • if the count value is invalid, the reason code is MQRC_CFSL_ERROR (no more specific MQSeries constant is defined)
  • if the stringLength value is invalid, the reason code is MQRC_CFSL_ERROR (no more specific MQSeries constant is defined)
  • if the strucLength value is invalid, the reason code is MQRCCF_CFSL_TOTAL_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 a MQCFH 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 MQCFSL (this will vary depending upon the string length and the size of the string array).
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 MQCFSL, this is an array of strings (type String[]).
Overrides:
getValue in class PCFParameter

getStringValue

public java.lang.String getStringValue()
Returns a single string representing the values of this PCF string array structure, one value per line.
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 MQCFSL, the value is an array of strings (type String[]). The strucLength, stringLength, count and strings fields are updated based upon the value parameter.
Overrides:
setValue in class PCFParameter
Parameters:
value - the string list value

setStrings

public void setStrings(java.lang.String[] strings)
Sets the MQCFSL string values in the strings field, also updating the strucLength, stringLength, and count fields.
Parameters:
strings - the string value array

toString

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