/*
 * $Id: MuleMessageCollection.java 11481 2008-03-22 19:27:20Z rossmason $
 * --------------------------------------------------------------------------------------
 * Copyright (c) MuleSource, Inc.  All rights reserved.  http://www.mulesource.com
 *
 * The software in this package is published under the terms of the CPAL v1.0
 * license, a copy of which has been included with this distribution in the
 * LICENSE.txt file.
 */
package org.mule.api;

import java.util.List;

/**
 * An interface that defines a collection of Mule Messages and methods for working with the collection.
 * Typically this type of message is only used when users explicitly want to work with aggregated or re-sequenced
 * collections of messages.
 */
public interface MuleMessageCollection extends MuleMessage
{
    public void addMessage(MuleMessage message);

    public void addMessage(MuleMessage message, int index);

    public void addMessages(MuleMessage[] messages);

    public void addMessages(MuleEvent[] events);

    public void addMessages(List messages);

    public void removedMessage(MuleMessage message);

    public MuleMessage[] getMessagesAsArray();

    public MuleMessage getMessage(int index);

    public Object[] getPayloadsAsArray();

    public int size();
}
