com.ibm.mq.pcf
Class PCFParameter

java.lang.Object
  |
  +--com.ibm.mq.pcf.PCFHeader
        |
        +--com.ibm.mq.pcf.PCFParameter
All Implemented Interfaces:
java.io.Serializable
Direct Known Subclasses:
MQCFIL, MQCFIN, MQCFSL, MQCFST

public abstract class PCFParameter
extends PCFHeader
implements java.io.Serializable

An abstract superclass for PCF parameter types (MQCFIN, MQCFIL, MQCFST and MQCFSL).

Version:
2.2
Author:
Chris Markes
See Also:
MQCFH, MQCFIN, MQCFIL, MQCFST, MQCFSL, Serialized Form

Field Summary
static java.lang.String copyright
           
 
Constructor Summary
PCFParameter()
           
 
Method Summary
abstract  int getParameter()
          Returns the parameter identifier of this PCF parameter structure.
abstract  java.lang.String getStringValue()
          Gets the value of this PCFParameter in a string form suitable for displaying.
abstract  int getType()
          Returns the type identifier of this PCF parameter structure.
abstract  java.lang.Object getValue()
          Returns the value of this PCF parameter structure.
static PCFParameter nextParameter(com.ibm.mq.MQMessage message)
          Returns the next PCF parameter header from a message.
abstract  void setValue(java.lang.Object value)
          Sets the value of this PCF parameter structure.
 
Methods inherited from class com.ibm.mq.pcf.PCFHeader
initialize, size, write
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

copyright

public static final java.lang.String copyright
Constructor Detail

PCFParameter

public PCFParameter()
Method Detail

nextParameter

public static PCFParameter nextParameter(com.ibm.mq.MQMessage message)
                                  throws com.ibm.mq.MQException,
                                         java.io.IOException
Returns the next PCF parameter header from a message. The object returned is an instance of MQCFIN, MQCFIL, MQCFST or MQCFSL. This method can be used to walk through a PCF response where the response contents are not well known in advance, or to search for a particular parameter where its position in the response can vary. For example, to find the queue name in a PCF response:
 
 	MQCFH 		cfh = new MQCFH (message);
 	PCFParameter 	p;
 	String 		name = null;
 
 	while (name == null)
 	{
 		p = PCFParameter.nextParameter (message);
 
 		if (p.getParameter () == CMQC.MQCA_Q_NAME)
 		{
 			name = (String) p.getValue ();
 		}
 	}
 
 
Parameters:
message - the message to read from
Throws:
com.ibm.mq.MQException - if the message does not contain a valid PCF parameter header at the current cursor position
java.io.IOException - if there is a problem reading the message
See Also:
MQCFH, MQCFIN, MQCFIL, MQCFST, MQCFSL, CMQCFC

getType

public abstract int getType()
Returns the type identifier of this PCF parameter structure.

getParameter

public abstract int getParameter()
Returns the parameter identifier of this PCF parameter structure.

getValue

public abstract java.lang.Object getValue()
Returns the value of this PCF parameter structure. This could be a single integer, a single string, or an array of integers or strings, as determined by the subclass implementing this method. The caller can determine what type is expected by inference using the value returned by the getParameter method.

getStringValue

public abstract java.lang.String getStringValue()
Gets the value of this PCFParameter in a string form suitable for displaying.

setValue

public abstract void setValue(java.lang.Object value)
                       throws java.lang.ClassCastException
Sets the value of this PCF parameter structure. This could be a single integer, a single string, or an array of integers or strings, as determined by the subclass implementing this method.