com.ibm.mq.headers.pcf
Class PCFHeaderFactory
- java.lang.Object
-
- com.ibm.mq.headers.pcf.PCFHeaderFactory
-
- All Implemented Interfaces:
- MQHeaderFactory
public class PCFHeaderFactory extends java.lang.Object implements MQHeaderFactory
MQHeaderFactory for PCF header structures and formats. The PCFHeaderFactory is registered with the default header registry.- See Also:
MQHeaderFactory
-
-
Nested Class Summary
-
Nested classes/interfaces inherited from interface com.ibm.mq.headers.MQHeaderFactory
MQHeaderFactory.Registry
-
-
Constructor Summary
Constructors Constructor and Description PCFHeaderFactory()
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method and Description MQHeadercreate(java.lang.String type)MQHeaderdecode(MQHeaderContext context)Decodes (parses) an MQHeader instance from a message.java.util.CollectiongetSupportedFormats()java.util.CollectiongetSupportedTypes()
-
-
-
Method Detail
-
create
public MQHeader create(java.lang.String type) throws java.lang.InstantiationException
- Specified by:
createin interfaceMQHeaderFactory- Returns:
- an MQHeader instance of the named type. The types known the header factory can be obtained from the getSupportedTypes method. These types correspond to the values returned by the type method on MQHeader instances.
- Throws:
java.lang.InstantiationException- See Also:
MQHeaderFactory.create(java.lang.String)
-
decode
public MQHeader decode(MQHeaderContext context) throws MQDataException, java.io.IOException
Description copied from interface:MQHeaderFactoryDecodes (parses) an MQHeader instance from a message. The message context object carries the format, encoding and CCSID associated with the current position in the message or byte stream. The operation of an MQHeaderFactory to fulfil this method is essentially:- Identify the header type that occurs next in the message. This may be known by the factory directly, and associated with the format; or the MQHeaderFactory may need to peek at the message content to detect the type.
- Having identified the correct type, instantiate an MQHeader instance of that type.
- Invoke the header object's read method on the message.
- Optionally, update the format, encoding and characterSet members of the message context object.
- Return the header instance.
- Specified by:
decodein interfaceMQHeaderFactory- Parameters:
context- the header context.- Returns:
- the parsed MQHeader
- Throws:
MQDataExceptionjava.io.IOException- See Also:
MQHeaderFactory.decode(com.ibm.mq.headers.MQHeaderContext)
-
getSupportedFormats
public java.util.Collection getSupportedFormats()
- Specified by:
getSupportedFormatsin interfaceMQHeaderFactory- Returns:
- the set of format names associated with the header types supported by this MQHeaderFactory. An MQHeaderFactory instance is capable of decoding messages of these formats.
- See Also:
MQHeaderFactory.getSupportedFormats()
-
getSupportedTypes
public java.util.Collection getSupportedTypes()
- Specified by:
getSupportedTypesin interfaceMQHeaderFactory- Returns:
- the set of header types supported by this MQHeaderFactory. An MQHeaderFactory instance can create new instances of these types.
- See Also:
MQHeaderFactory.getSupportedTypes()
-
-