org.fusesource.examples.eip
Class RegionSupport
java.lang.Object
org.fusesource.examples.eip.RegionSupport
public class RegionSupport
- extends java.lang.Object
This class contains business logic that determines the region for a country. It is used by the
Camel route in this example.
|
Field Summary |
static java.lang.String |
AMER
|
static java.lang.String |
APAC
|
static java.lang.String |
EMEA
|
|
Method Summary |
java.lang.String |
getRegion(java.lang.String country)
Get the region code that corresponds to the given country code. |
| Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
AMER
public static final java.lang.String AMER
- See Also:
- Constant Field Values
APAC
public static final java.lang.String APAC
- See Also:
- Constant Field Values
EMEA
public static final java.lang.String EMEA
- See Also:
- Constant Field Values
RegionSupport
public RegionSupport()
getRegion
public java.lang.String getRegion(@XPath(value="/order:order/order:customer/order:country",namespaces=@NamespacePrefix(prefix="order",uri="http://fusesource.com/examples/order/v7"))
java.lang.String country)
- Get the region code that corresponds to the given country code.
This method can be used as a plain Java method. However, when it is used inside a Camel
route, the @XPath annotation will evaluate the XPath expression and use the result as the
method parameter. In this case, it will fetch the country code from the order XML message.
So, the method will determine the region code for the country that is in the XML message.
- Parameters:
country - the country code
- Returns:
- the region code
Copyright © 2012 FuseSource. All Rights Reserved.