org.apache.synapse.transport.netty.sender

## Class SourceResponseHandler

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

-     public class SourceResponseHandler
      extends java.lang.Object

  `SourceResponseHandler` have utilities for creating and preparing an outbound response to be sent to the HTTP client.

- - ### Constructor Summary

    Constructors
    Constructor and Description
    `SourceResponseHandler()`

  - ### Method Summary

    All Methods Static Methods Concrete Methods
    Modifier and Type | Method and Description
    --- | ---
    `static boolean` | `canOutboundResponseHaveContentTypeHeader(org.apache.axis2.context.MessageContext msgContext)`
    `static org.wso2.transport.http.netty.message.HttpCarbonMessage` | `createOutboundResponseMsg(org.apache.axis2.context.MessageContext msgCtx, org.wso2.transport.http.netty.message.HttpCarbonMessage clientRequest)` Creates outbound response to be sent back to the HTTP client using the axis2 message context and the original client request.
    `static java.lang.String` | `getContentTypeForOutboundResponse(org.apache.axis2.context.MessageContext msgContext)`
    `static boolean` | `isPassThroughMessage(org.apache.axis2.context.MessageContext msgContext)` The pass through (when message body is not built) status of the message.
    `static void` | `sendResponse(org.apache.axis2.context.MessageContext msgCtx, org.wso2.transport.http.netty.message.HttpCarbonMessage inboundRequestMsg, org.wso2.transport.http.netty.message.HttpCarbonMessage outboundResponseMsg)` Writes the response headers and the response body to the client.

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

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

- - ### Constructor Detail

    - #### SourceResponseHandler

          public SourceResponseHandler()

  - ### Method Detail

    - #### createOutboundResponseMsg

          public static org.wso2.transport.http.netty.message.HttpCarbonMessage createOutboundResponseMsg(org.apache.axis2.context.MessageContext msgCtx,
                                                                                                          org.wso2.transport.http.netty.message.HttpCarbonMessage clientRequest)
                                                                                                   throws org.apache.axis2.AxisFault

      Creates outbound response to be sent back to the HTTP client using the axis2 message context and the original client request.
      Parameters:
        `msgCtx` - axis2 message context
        `clientRequest` - original HTTP client request
      Returns:
        the outbound response HttpCarbonMessage
      Throws:
        `org.apache.axis2.AxisFault` - if something goes wrong when creating the outbound response

    - #### canOutboundResponseHaveContentTypeHeader

          public static boolean canOutboundResponseHaveContentTypeHeader(org.apache.axis2.context.MessageContext msgContext)

    - #### getContentTypeForOutboundResponse

          public static java.lang.String getContentTypeForOutboundResponse(org.apache.axis2.context.MessageContext msgContext)
                                                                    throws org.apache.axis2.AxisFault

      Throws:
        `org.apache.axis2.AxisFault`

    - #### isPassThroughMessage

          public static boolean isPassThroughMessage(org.apache.axis2.context.MessageContext msgContext)

      The pass through (when message body is not built) status of the message.
      Returns:
        true if it is a pass through.

    - #### sendResponse

          public static void sendResponse(org.apache.axis2.context.MessageContext msgCtx,
                                          org.wso2.transport.http.netty.message.HttpCarbonMessage inboundRequestMsg,
                                          org.wso2.transport.http.netty.message.HttpCarbonMessage outboundResponseMsg)
                                   throws org.apache.axis2.AxisFault

      Writes the response headers and the response body to the client.
      Parameters:
        `msgCtx` - axis2 message context
        `inboundRequestMsg` - inbound request carbon message
        `outboundResponseMsg` - outbound response carbon message
      Throws:
        `org.apache.axis2.AxisFault` - if something goes wrong when sending out the response

Copyright © 2005-2022 Apache Software Foundation. All Rights Reserved.