org.ikasan.framework.component.routing
Class FirstPayloadAttributeRouter

java.lang.Object
  extended by org.ikasan.framework.component.routing.SingleResultRouter
      extended by 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

Field Summary
 
Fields inherited from interface org.ikasan.framework.component.routing.Router
DEFAULT_RESULT
 
Constructor Summary
FirstPayloadAttributeRouter(String attributeName, Map<String,String> attributeValuesToResults, boolean returnsDefaultForNonMatches)
          Constructor
 
Method Summary
protected  String evaluate(Event event)
          Returns a single value as a result of evaluating the Event
 
Methods inherited from class org.ikasan.framework.component.routing.SingleResultRouter
onEvent
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

FirstPayloadAttributeRouter

public FirstPayloadAttributeRouter(String attributeName,
                                   Map<String,String> attributeValuesToResults,
                                   boolean returnsDefaultForNonMatches)
Constructor

Parameters:
attributeName - - name of Payload attribute upon whose value we wish to switch
attributeValuesToResults - -Mapping of expected attribute values, to the result that should be returned if that attribute value is matched
returnsDefaultForNonMatches - - flag, if set to true, will allow default result to be returned on non matches, otherwise exception will be thrown
Method Detail

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.