public class PassThroughTransportUtils extends Object
Constructor and Description |
---|
PassThroughTransportUtils() |
Modifier and Type | Method and Description |
---|---|
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 String |
determineHttpStatusLine(org.apache.axis2.context.MessageContext msgContext)
Determine the Http Status Message 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 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 String |
getIpAddress()
Whatever this method returns as the IP is ignored by the actual http/s listener when
its getServiceEPR is invoked.
|
static org.apache.axiom.om.OMOutputFormat |
getOMOutputFormat(org.apache.axis2.context.MessageContext msgContext) |
String |
getServicesHTML(String prefix,
org.apache.axis2.context.ConfigurationContext cfgCtx)
Returns the HTML text for the list of services deployed.
|
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 String determineHttpStatusLine(org.apache.axis2.context.MessageContext msgContext)
msgContext
- the Axis2 message contextPassThroughConstants.FAULTS_AS_HTTP_200
,
PassThroughConstants.HTTP_SC
public static String getIpAddress() throws SocketException
SocketException
- if the socket can not be accessedpublic String getServicesHTML(String prefix, org.apache.axis2.context.ConfigurationContext cfgCtx)
prefix
- to be used for the Service namescfgCtx
- axis2 configuration contextpublic static org.apache.axiom.om.OMOutputFormat getOMOutputFormat(org.apache.axis2.context.MessageContext msgContext)
Copyright © 2005–2019 Apache Software Foundation. All rights reserved.