public class PassThroughTransportUtils extends Object
Constructor and Description |
---|
PassThroughTransportUtils() |
Modifier and Type | Method and Description |
---|---|
static boolean |
builderInvoked(org.apache.axis2.context.MessageContext messageContext) |
static int |
determineHttpStatusCode(org.apache.axis2.context.MessageContext msgContext)
Determine the Http Status Code depending on the message type processed
(normal response versus fault response) as well as Axis2 message context properties set via Synapse configuration or MessageBuilders. |
static void |
finishUsingSourceConnection(org.apache.http.HttpResponse response,
org.apache.http.nio.NHttpServerConnection conn,
SourceConnections connections) |
static void |
finishUsingTargetConnection(org.apache.http.HttpResponse response,
org.apache.http.nio.NHttpClientConnection conn,
TargetConnections connections) |
static org.apache.axis2.addressing.EndpointReference |
getDestinationEPR(org.apache.axis2.context.MessageContext msgContext)
Get the EPR for the message passed in
|
static String |
getHostName(InetAddress address)
This method tries to determine the hostname of the given InetAddress without
triggering a reverse DNS lookup.
|
static org.apache.axiom.om.OMOutputFormat |
getOMOutputFormat(org.apache.axis2.context.MessageContext msgContext) |
static void |
removeUnwantedHeaders(org.apache.axis2.context.MessageContext msgContext,
TargetConfiguration targetConfiguration)
Remove unwanted headers from the http response of outgoing request.
|
public static String getHostName(InetAddress address)
InetAddress.getHostName()
triggers a reverse DNS lookup which can be very costly in cases where reverse
DNS fails. Tries to parse a symbolic hostname from InetAddress.toString()
,
which is documented to return a String of the form "hostname / literal IP address"
with 'hostname' blank if not already computed & stored in address
.
If the hostname cannot be determined from InetAddress.toString(),
the value of InetAddress.getHostAddress()
is returned.address
- The InetAddress whose hostname has to be determinedpublic static org.apache.axis2.addressing.EndpointReference getDestinationEPR(org.apache.axis2.context.MessageContext msgContext)
msgContext
- the message contextpublic static void removeUnwantedHeaders(org.apache.axis2.context.MessageContext msgContext, TargetConfiguration targetConfiguration)
msgContext
- the Axis2 Message context from which these headers should be removedtargetConfiguration
- configuration for the passThrough handlerpublic static int determineHttpStatusCode(org.apache.axis2.context.MessageContext msgContext)
msgContext
- the Axis2 message contextPassThroughConstants.FAULTS_AS_HTTP_200
,
PassThroughConstants.HTTP_SC
public static org.apache.axiom.om.OMOutputFormat getOMOutputFormat(org.apache.axis2.context.MessageContext msgContext)
public static boolean builderInvoked(org.apache.axis2.context.MessageContext messageContext)
public static void finishUsingSourceConnection(org.apache.http.HttpResponse response, org.apache.http.nio.NHttpServerConnection conn, SourceConnections connections)
public static void finishUsingTargetConnection(org.apache.http.HttpResponse response, org.apache.http.nio.NHttpClientConnection conn, TargetConnections connections)
Copyright © 2005-2017 Apache Software Foundation. All Rights Reserved.