Class SIPExchangeHelper
- java.lang.Object
-
- org.apache.camel.support.DefaultExchangeHolder
-
- de.ikor.sip.foundation.testkit.util.SIPExchangeHelper
-
- All Implemented Interfaces:
Serializable
public class SIPExchangeHelper extends org.apache.camel.support.DefaultExchangeHolder
Utility class that changes theExchange
- See Also:
- Serialized Form
-
-
Constructor Summary
Constructors Constructor Description SIPExchangeHelper()
-
Method Summary
All Methods Static Methods Concrete Methods Modifier and Type Method Description static org.apache.camel.Exchange
createEmptyExchange(org.apache.camel.CamelContext camelContext)
Creates an emptyExchange
protected static Map<String,Object>
filterNonSerializableHeaders(org.apache.camel.Exchange exchange)
Filters out all non-serializable headers so they can be used in serializable environmentstatic String
getRouteId(org.apache.camel.Exchange exchange)
Get route id from theExchange
static MessageProperties
mapToMessageProperties(org.apache.camel.Exchange exchange)
Creates aMessageProperties
from theExchange
static org.apache.camel.Exchange
parseExchangeProperties(EndpointProperties properties, org.apache.camel.CamelContext camelContext)
Create exchange from test definitionprotected static Object
reassignNonSerializableValue(String headerName, Object value)
static org.apache.camel.Consumer
resolveConsumer(org.apache.camel.Exchange exchange, org.apache.camel.CamelContext camelContext)
Get camel consumer based on exchange route idstatic org.apache.camel.Endpoint
resolveEndpoint(org.apache.camel.Exchange exchange, org.apache.camel.CamelContext camelContext)
Get camel endpoint based on exchange route idstatic org.apache.camel.Route
resolveRoute(org.apache.camel.Exchange exchange, org.apache.camel.CamelContext camelContext)
Get camel route based on exchange route id
-
-
-
Method Detail
-
filterNonSerializableHeaders
protected static Map<String,Object> filterNonSerializableHeaders(org.apache.camel.Exchange exchange)
Filters out all non-serializable headers so they can be used in serializable environment- Parameters:
exchange
- whose headers should be checked- Returns:
- Map of headers that are serializable
-
reassignNonSerializableValue
protected static Object reassignNonSerializableValue(String headerName, Object value)
-
mapToMessageProperties
public static MessageProperties mapToMessageProperties(org.apache.camel.Exchange exchange)
Creates aMessageProperties
from theExchange
- Parameters:
exchange
- that should be mapped- Returns:
- serializable message properties
-
getRouteId
public static String getRouteId(org.apache.camel.Exchange exchange)
Get route id from theExchange
- Parameters:
exchange
- that should be mapped- Returns:
- route id
-
resolveEndpoint
public static org.apache.camel.Endpoint resolveEndpoint(org.apache.camel.Exchange exchange, org.apache.camel.CamelContext camelContext)
Get camel endpoint based on exchange route id- Parameters:
exchange
- for fetching the route idcamelContext
- in which endpoints are defined- Returns:
Endpoint
-
resolveRoute
public static org.apache.camel.Route resolveRoute(org.apache.camel.Exchange exchange, org.apache.camel.CamelContext camelContext)
Get camel route based on exchange route id- Parameters:
exchange
- for fetching the route idcamelContext
- in which routes are defined- Returns:
Route
-
resolveConsumer
public static org.apache.camel.Consumer resolveConsumer(org.apache.camel.Exchange exchange, org.apache.camel.CamelContext camelContext)
Get camel consumer based on exchange route id- Parameters:
exchange
- for fetching the route idcamelContext
- in which consumers are defined- Returns:
Route
-
createEmptyExchange
public static org.apache.camel.Exchange createEmptyExchange(org.apache.camel.CamelContext camelContext)
Creates an emptyExchange
- Parameters:
camelContext
- is necessary for creation- Returns:
- exchange
-
parseExchangeProperties
public static org.apache.camel.Exchange parseExchangeProperties(EndpointProperties properties, org.apache.camel.CamelContext camelContext)
Create exchange from test definition- Parameters:
properties
- with route id and payload for exchange bodycamelContext
- camel context- Returns:
Exchange
-
-