com.ibm.broker.plugin

Class MbMessageCollection



  • public class MbMessageCollection
    extends MbMessage
    MbMessageCollection represents a message collection that can be passed between the nodes in a message flow. A message collection is a specialisation of an Integration Bus message (MbMessage). The last child of the root of the message is an element called "Collection" and has a Collection parser associated with it. The children of the Collection element are either name value types that do not have an associated parser or are the root elements of Integration Bus message structures and will have an appropriate parser associated with them. In the case of structures created using this MbMessageCollection class, the message roots are referred to as folders. The folders can be given any name you require and will be associated with a CollectionFolder parser. Typically, any name value elements will preceed any folder element children of the Collection element. The following diagram illustrates the structure of a message collection.
                        +------+
                        | Root | (A)
                        +--+---+
                           |
                     +-----+------+
                     | Collection | (A)
                     +-----+------+
                           |
           +----------+----+-------+--------------+
           |          |            |              |
        +--+--+    +--+--+    +----+----+    +----+----+
        | nv1 |    | nv2 |    | folder1 |    | folder2 |
        +-----+    +-----+    +----+----+    +----+----+
          (B)        (B)       (C) |          (C) |
                       +-----------+----------+                   
                       |                      |    
                 +-----+------+           +--------+
                 | Properties |   - - -   | XMLNSC |
                 +-----+------+    (D)    +---+----+
                       |                      |
                                           +--+--+
                                           | msg |
                                           +--+--+
                                              |
     
     

    The elements in the diagram marked (A), (B) and (C) are created by methods of the MbMessageCollection class. Other elements, such as the children of the folder elements and their children in Properties and message body related children are created via their parent elements using the createAs...() methods of the MbElement class. See createElementAsLastChild as an example. There may be other header elements at (D) in the diagram.

    The elements marked (A) in the above diagram are created by the MbMessageCollection constructor.

    The elements marked (B) are created using the createNameValue() method.

    The elements marked (C) are created using the createFolder() method.

    See Also:
    MbElement, "Working with Messages. Appendix A: Message Parsers - element definitions"
    • Constructor Detail

      • MbMessageCollection

        public MbMessageCollection()
                            throws MbException
        Default constructor for MbMessageCollection
        Throws:
        MbException
    • Method Detail

      • createFolder

        public MbElement createFolder(java.lang.String folderName)
                               throws MbException
        Creates a folder element as the last child of the Collection element of the message collection. The element will be named using the String passed as the folderName argument. A CollectionFolder parser will be associated with the created element.
        Parameters:
        folderName - The name of the folder to be created
        Throws:
        MbException
      • createNameValue

        public MbElement createNameValue(java.lang.String name,
                                         java.lang.Object value)
                                  throws MbException
        Creates a name-value element as the last child of the Collection element of the message collection. The element will be named using the String passed as the name argument. The value of the element will be the value argument to this method. Note that the same restrictions apply to the type of object that can be passed as the value argument as apply to the value arguments of the MbElement createElementAs...() methods. See createElementAsLastChild for details.
        Parameters:
        name - The name of the element to be created.
        value - The value of the element to be created. Restrictions apply to the type of object that may be supplied, see createElementAsLastChild for details.
        Throws:
        MbException
IBM Integration BusTM
JavaTM Plugin Node API