org.apache.synapse.transport.passthru

## Class TargetResponse

- java.lang.Object
- - org.apache.synapse.transport.passthru.TargetResponse

-     public class TargetResponse
      extends java.lang.Object

  This class represents a response coming from the target server.

- - ### Constructor Summary

    Constructors
    Constructor and Description
    `TargetResponse(TargetConfiguration targetConfiguration, org.apache.http.HttpResponse response, org.apache.http.nio.NHttpClientConnection conn, boolean expectResponseBody, boolean forceShutdownConnectionOnComplete)`

  - ### Method Summary

    All Methods Instance Methods Concrete Methods
    Modifier and Type | Method and Description
    --- | ---
    `void` | `addExcessHeader(org.apache.http.Header h)`
    `java.nio.ByteBuffer` | `copyAndRead(org.apache.http.nio.NHttpClientConnection conn, org.apache.http.nio.ContentDecoder decoder)` Same as `read(org.apache.http.nio.NHttpClientConnection, org.apache.http.nio.ContentDecoder)` but gives out the data read from the wire in to the pipe.
    `org.apache.http.nio.NHttpClientConnection` | `getConnection()`
    `java.util.Map` | `getExcessHeaders()`
    `java.lang.String` | `getHeader(java.lang.String name)`
    `java.util.Map<java.lang.String,java.lang.String>` | `getHeaders()`
    `Pipe` | `getPipe()`
    `int` | `getStatus()`
    `java.lang.String` | `getStatusLine()`
    `org.apache.http.ProtocolVersion` | `getVersion()`
    `boolean` | `isExpectResponseBody()`
    `int` | `read(org.apache.http.nio.NHttpClientConnection conn, org.apache.http.nio.ContentDecoder decoder)` Read the data from the wire and read in to the pipe so that other end of the pipe can write.
    `void` | `start(org.apache.http.nio.NHttpClientConnection conn)` Starts the response

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

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

- - ### Constructor Detail

    - #### TargetResponse

          public TargetResponse(TargetConfiguration targetConfiguration,
                                org.apache.http.HttpResponse response,
                                org.apache.http.nio.NHttpClientConnection conn,
                                boolean expectResponseBody,
                                boolean forceShutdownConnectionOnComplete)

  - ### Method Detail

    - #### start

          public void start(org.apache.http.nio.NHttpClientConnection conn)

      Starts the response
      Parameters:
        `conn` - the client connection

    - #### read

          public int read(org.apache.http.nio.NHttpClientConnection conn,
                          org.apache.http.nio.ContentDecoder decoder)
                   throws java.io.IOException

      Read the data from the wire and read in to the pipe so that other end of the pipe can write.
      Parameters:
        `conn` - the target connection
        `decoder` - content decoder
      Returns:
        number of bites read
      Throws:
        `java.io.IOException` - if an error occurs

    - #### copyAndRead

          public java.nio.ByteBuffer copyAndRead(org.apache.http.nio.NHttpClientConnection conn,
                                                 org.apache.http.nio.ContentDecoder decoder)
                                          throws java.io.IOException

      Same as `read(org.apache.http.nio.NHttpClientConnection, org.apache.http.nio.ContentDecoder)` but gives out the data read from the wire in to the pipe.
      Parameters:
        `conn` - the target connection
        `decoder` - content decoder
      Returns:
        data read
      Throws:
        `java.io.IOException` - if an error occurs

    - #### getHeader

          public java.lang.String getHeader(java.lang.String name)

    - #### getHeaders

          public java.util.Map<java.lang.String,java.lang.String> getHeaders()

    - #### getExcessHeaders

          public java.util.Map getExcessHeaders()

    - #### addExcessHeader

          public void addExcessHeader(org.apache.http.Header h)

    - #### getPipe

          public Pipe getPipe()

    - #### getStatus

          public int getStatus()

    - #### getStatusLine

          public java.lang.String getStatusLine()

    - #### isExpectResponseBody

          public boolean isExpectResponseBody()

    - #### getConnection

          public org.apache.http.nio.NHttpClientConnection getConnection()

    - #### getVersion

          public org.apache.http.ProtocolVersion getVersion()

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