org.ikasan.framework.component.routing
Class FirstPayloadAttributeRouter
java.lang.Object
org.ikasan.framework.component.routing.SingleResultRouter
org.ikasan.framework.component.routing.FirstPayloadAttributeRouter
- All Implemented Interfaces:
- Router, FlowComponent
public class FirstPayloadAttributeRouter
- extends SingleResultRouter
Simple Router that routes Events to a single configured path based on the value of a named attribute
on the Events first Payload
If there is no configured path for the attribute value (or this is null), then a single default result is returned
- Author:
- Ikasan Development Team
|
Method Summary |
protected String |
evaluate(Event event)
Returns a single value as a result of evaluating the Event |
| Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
FirstPayloadAttributeRouter
public FirstPayloadAttributeRouter(String attributeName,
Map<String,String> attributeValuesToResults,
boolean returnsDefaultForNonMatches)
- Constructor
- Parameters:
attributeName - - name of Payload attribute upon whose value we wish to switchattributeValuesToResults - -Mapping of expected attribute values, to the result that should be returned if that attribute value
is matchedreturnsDefaultForNonMatches - - flag, if set to true, will allow default result to be returned on non
matches, otherwise exception will be thrown
evaluate
protected String evaluate(Event event)
throws RouterException
- Description copied from class:
SingleResultRouter
- Returns a single value as a result of evaluating the
Event
- Specified by:
evaluate in class SingleResultRouter
- Parameters:
event - to evaluate
- Returns:
- result
- Throws:
RouterException - Exception if we could not route the event
Copyright © 2007-2012 Ikasan. All Rights Reserved.