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
    • Constructor Detail

      • PCFHeaderFactory

        public PCFHeaderFactory()
    • Method Detail

      • create

        public MQHeader create(java.lang.String type)
                        throws java.lang.InstantiationException
        Specified by:
        create in interface MQHeaderFactory
        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: MQHeaderFactory
        Decodes (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:
        1. 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.
        2. Having identified the correct type, instantiate an MQHeader instance of that type.
        3. Invoke the header object's read method on the message.
        4. Optionally, update the format, encoding and characterSet members of the message context object.
        5. Return the header instance.
        This method may return null if no more headers are present or this MQHeaderFactory cannot identify a header at the current position in the message.
        Specified by:
        decode in interface MQHeaderFactory
        Parameters:
        context - the header context.
        Returns:
        the parsed MQHeader
        Throws:
        MQDataException
        java.io.IOException
        See Also:
        MQHeaderFactory.decode(com.ibm.mq.headers.MQHeaderContext)
      • getSupportedFormats

        public java.util.Collection getSupportedFormats()
        Specified by:
        getSupportedFormats in interface MQHeaderFactory
        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()
(c) Copyright IBM Corp. 2008, 2016. All Rights Reserved.