Package org.apache.synapse.transport.netty.sender

## Class TargetRequestHandler

- java.lang.Object
- - org.apache.synapse.transport.netty.sender.TargetRequestHandler

-     public class TargetRequestHandler
      extends Object

  `TargetRequestHandler` have utilities for creating and preparing an outbound request to be sent to the backend service.

- - ### Constructor Summary

    Constructors
    Constructor | Description
    --- | ---
    `TargetRequestHandler()` |

  - ### Method Summary

    All Methods Static Methods Concrete Methods
    Modifier and Type | Method | Description
    --- | --- | ---
    `static org.wso2.transport.http.netty.contract.HttpClientConnector` | `createHttpClient​(URL url, org.apache.axis2.context.MessageContext msgContext, org.wso2.transport.http.netty.contract.HttpWsConnectorFactory httpWsConnectorFactory, org.wso2.transport.http.netty.contractimpl.sender.channel.pool.ConnectionManager connectionManager, org.wso2.transport.http.netty.contractimpl.sender.channel.BootstrapConfiguration bootstrapConfiguration, TargetConfiguration targetConfiguration)` |
    `static org.wso2.transport.http.netty.message.HttpCarbonMessage` | `createOutboundRequestMsg​(URL url, org.apache.axis2.context.MessageContext msgContext, TargetConfiguration targetConfiguration)` | Creates outbound request to be sent to the Backend service.
    `static String` | `getContentType​(org.apache.axis2.context.MessageContext msgCtx, boolean isContentTypePreservedHeader, Map trpHeaders)` |
    `static void` | `populateSenderConfigurations​(org.apache.axis2.context.MessageContext msgContext, org.wso2.transport.http.netty.contract.config.SenderConfiguration senderConfiguration, TargetConfiguration targetConfiguration, URL url)` |
    `static void` | `sendRequest​(org.wso2.transport.http.netty.contract.HttpClientConnector clientConnector, org.wso2.transport.http.netty.message.HttpCarbonMessage outboundRequestMsg, org.apache.axis2.context.MessageContext msgContext, TargetConfiguration targetConfiguration)` |
    `static boolean` | `shouldOverwriteContentType​(org.apache.axis2.context.MessageContext msgContext, org.wso2.transport.http.netty.message.HttpCarbonMessage outboundRequest)` | Check whether the we should overwrite the content type for the outgoing request.

    - ### Methods inherited from class java.lang.Object

      `clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait`

- - ### Constructor Detail

    - #### TargetRequestHandler

          public TargetRequestHandler()

  - ### Method Detail

    - #### createOutboundRequestMsg

          public static org.wso2.transport.http.netty.message.HttpCarbonMessage createOutboundRequestMsg​(URL url,
                                                                                                         org.apache.axis2.context.MessageContext msgContext,
                                                                                                         TargetConfiguration targetConfiguration)
                                                                                                  throws org.apache.axis2.AxisFault

      Creates outbound request to be sent to the Backend service.
      Parameters:
        `url` - URL of the backend service
        `msgContext` - axis2 message context
        `targetConfiguration` - configurations of the Transport Sender
      Returns:
        the outbound request HttpCarbonMessage
      Throws:
        `org.apache.axis2.AxisFault`

    - #### getContentType

          public static String getContentType​(org.apache.axis2.context.MessageContext msgCtx,
                                              boolean isContentTypePreservedHeader,
                                              Map trpHeaders)
                                       throws org.apache.axis2.AxisFault

      Throws:
        `org.apache.axis2.AxisFault`

    - #### shouldOverwriteContentType

          public static boolean shouldOverwriteContentType​(org.apache.axis2.context.MessageContext msgContext,
                                                           org.wso2.transport.http.netty.message.HttpCarbonMessage outboundRequest)

      Check whether the we should overwrite the content type for the outgoing request.
      Parameters:
        `msgContext` - MessageContext
      Returns:
        whether to overwrite the content type for the outgoing request

    - #### createHttpClient

          public static org.wso2.transport.http.netty.contract.HttpClientConnector createHttpClient​(URL url,
                                                                                                    org.apache.axis2.context.MessageContext msgContext,
                                                                                                    org.wso2.transport.http.netty.contract.HttpWsConnectorFactory httpWsConnectorFactory,
                                                                                                    org.wso2.transport.http.netty.contractimpl.sender.channel.pool.ConnectionManager connectionManager,
                                                                                                    org.wso2.transport.http.netty.contractimpl.sender.channel.BootstrapConfiguration bootstrapConfiguration,
                                                                                                    TargetConfiguration targetConfiguration)
                                                                                             throws org.apache.axis2.AxisFault

      Throws:
        `org.apache.axis2.AxisFault`

    - #### populateSenderConfigurations

          public static void populateSenderConfigurations​(org.apache.axis2.context.MessageContext msgContext,
                                                          org.wso2.transport.http.netty.contract.config.SenderConfiguration senderConfiguration,
                                                          TargetConfiguration targetConfiguration,
                                                          URL url)
                                                   throws org.apache.axis2.AxisFault

      Throws:
        `org.apache.axis2.AxisFault`

    - #### sendRequest

          public static void sendRequest​(org.wso2.transport.http.netty.contract.HttpClientConnector clientConnector,
                                         org.wso2.transport.http.netty.message.HttpCarbonMessage outboundRequestMsg,
                                         org.apache.axis2.context.MessageContext msgContext,
                                         TargetConfiguration targetConfiguration)
                                  throws org.apache.axis2.AxisFault

      Throws:
        `org.apache.axis2.AxisFault`