org.mule.api.routing
Class AggregationContext

java.lang.Object
  extended by org.mule.api.routing.AggregationContext

public final class AggregationContext
extends Object

Immutable object used to provide all the necessary information to perform an aggregation operation in one single parameter, helping to maintain consistent and simple signatures across aggregators The most important attribute in this class is events which holds the events to be aggregated. These events need to be ordered so that each event's index corresponds to the index of each route

Since:
3.5.0

Constructor Summary
AggregationContext(MuleEvent originalEvent, List<MuleEvent> events)
          Creates a new instance
 
Method Summary
 List<MuleEvent> collectEventsWithExceptions()
          Returns all the MuleEvents which messages have a not null ExceptionPayload and a not null ExceptionPayload.getException().
 List<MuleEvent> collectEventsWithoutExceptions()
          The exact opposite to collectEventsWithExceptions() Returns all the MuleEvents which messages have a null ExceptionPayload or a null ExceptionPayload.getException().
 NavigableMap<Integer,Throwable> collectRouteExceptions()
          Returns a NavigableMap in which the key is a zero-based route index and the value is an Throwable generated by it.
 List<MuleEvent> getEvents()
           
 MuleEvent getOriginalEvent()
           
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

AggregationContext

public AggregationContext(MuleEvent originalEvent,
                          List<MuleEvent> events)
Creates a new instance

Parameters:
originalEvent - a MuleEvent. Can be null
events - a List of MuleEvent. Cannot be null but could be empty. In that case, is up to each consumer to decide wether to fail or not
Method Detail

collectEventsWithExceptions

public List<MuleEvent> collectEventsWithExceptions()
Returns all the MuleEvents which messages have a not null ExceptionPayload and a not null ExceptionPayload.getException(). Notice that this is a select operation. Each time this method is invoked the result will be re-calculated

Returns:
a list of MuleEvent. It could be empty but it will never be null

collectRouteExceptions

public NavigableMap<Integer,Throwable> collectRouteExceptions()
Returns a NavigableMap in which the key is a zero-based route index and the value is an Throwable generated by it. Notice that this is a collect operation. Each time this method is invoked the result will be re-calculated

Returns:
a @{link NavigableMap. It could be empty but it will never be null

collectEventsWithoutExceptions

public List<MuleEvent> collectEventsWithoutExceptions()
The exact opposite to collectEventsWithExceptions() Returns all the MuleEvents which messages have a null ExceptionPayload or a null ExceptionPayload.getException(). Notice that this is a collect operation. Each time this method is invoked the result will be re-calculated

Returns:
a list of MuleEvent. It could be empty but it will never be null

getOriginalEvent

public MuleEvent getOriginalEvent()

getEvents

public List<MuleEvent> getEvents()


Copyright © 2003-2014 MuleSoft, Inc.. All Rights Reserved.