|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||
java.lang.Objectorg.apache.synapse.transport.passthru.util.PassThroughTransportUtils
public class PassThroughTransportUtils
Utility methods used by the transport.
| Constructor Summary | |
|---|---|
PassThroughTransportUtils()
|
|
| Method Summary | |
|---|---|
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 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,
boolean preserveServerHeader,
boolean preserveUserAgentHeader)
Remove unwanted headers from the http response of outgoing request. |
| Methods inherited from class java.lang.Object |
|---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
| Constructor Detail |
|---|
public PassThroughTransportUtils()
| Method Detail |
|---|
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 determined
public static org.apache.axis2.addressing.EndpointReference getDestinationEPR(org.apache.axis2.context.MessageContext msgContext)
msgContext - the message context
public static void removeUnwantedHeaders(org.apache.axis2.context.MessageContext msgContext,
boolean preserveServerHeader,
boolean preserveUserAgentHeader)
msgContext - the Axis2 Message context from which these headers should be removedpreserveServerHeader - if true preserve the original server headerpreserveUserAgentHeader - if true preserve the original user-agent headerpublic static int determineHttpStatusCode(org.apache.axis2.context.MessageContext msgContext)
msgContext - the Axis2 message context
PassThroughConstants.FAULTS_AS_HTTP_200,
PassThroughConstants.HTTP_SC
public static String getIpAddress()
throws SocketException
SocketException - if the socket can not be accessed
public String getServicesHTML(String prefix,
org.apache.axis2.context.ConfigurationContext cfgCtx)
prefix - to be used for the Service namescfgCtx - axis2 configuration context
public static org.apache.axiom.om.OMOutputFormat getOMOutputFormat(org.apache.axis2.context.MessageContext msgContext)
|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||