org.apache.synapse.transport.passthru

## Class SourceResponse

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

-     public class SourceResponse
      extends java.lang.Object

- - ### Constructor Summary

    Constructors
    Constructor and Description
    `SourceResponse(SourceConfiguration config, int status, SourceRequest request)`
    `SourceResponse(SourceConfiguration config, int status, java.lang.String statusLine, SourceRequest request)`

  - ### Method Summary

    All Methods Instance Methods Concrete Methods
    Modifier and Type | Method and Description
    --- | ---
    `void` | `addHeader(java.lang.String name, java.lang.String value)`
    `void` | `checkResponseChunkDisable(org.apache.axis2.context.MessageContext responseMsgContext)`
    `void` | `connect(Pipe pipe)`
    `java.nio.ByteBuffer` | `copyAndWrite(org.apache.http.nio.NHttpServerConnection conn, org.apache.http.nio.ContentEncoder encoder)` Same as `write(org.apache.http.nio.NHttpServerConnection, org.apache.http.nio.ContentEncoder)` but gives out the data consumed through the Pipe
    `java.lang.String` | `getHeader(java.lang.String name)`
    `boolean` | `hasEntity()`
    `void` | `removeHeader(java.lang.String name)`
    `void` | `setKeepAlive(boolean keepAlive)`
    `void` | `setStatus(int status)`
    `void` | `start(org.apache.http.nio.NHttpServerConnection conn)` Starts the response by writing the headers
    `int` | `write(org.apache.http.nio.NHttpServerConnection conn, org.apache.http.nio.ContentEncoder encoder)` Consume the content through the Pipe and write them to the wire

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

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

- - ### Constructor Detail

    - #### SourceResponse

          public SourceResponse(SourceConfiguration config,
                                int status,
                                SourceRequest request)

    - #### SourceResponse

          public SourceResponse(SourceConfiguration config,
                                int status,
                                java.lang.String statusLine,
                                SourceRequest request)

  - ### Method Detail

    - #### connect

          public void connect(Pipe pipe)

    - #### start

          public void start(org.apache.http.nio.NHttpServerConnection conn)
                     throws java.io.IOException,
                            org.apache.http.HttpException

      Starts the response by writing the headers
      Parameters:
        `conn` - connection
      Throws:
        `java.io.IOException` - if an error occurs
        `org.apache.http.HttpException` - if an error occurs

    - #### checkResponseChunkDisable

          public void checkResponseChunkDisable(org.apache.axis2.context.MessageContext responseMsgContext)
                                         throws java.io.IOException

      Throws:
        `java.io.IOException`

    - #### write

          public int write(org.apache.http.nio.NHttpServerConnection conn,
                           org.apache.http.nio.ContentEncoder encoder)
                    throws java.io.IOException

      Consume the content through the Pipe and write them to the wire
      Parameters:
        `conn` - connection
        `encoder` - encoder
      Returns:
        number of bytes written
      Throws:
        `java.io.IOException` - if an error occurs

    - #### copyAndWrite

          public java.nio.ByteBuffer copyAndWrite(org.apache.http.nio.NHttpServerConnection conn,
                                                  org.apache.http.nio.ContentEncoder encoder)
                                           throws java.io.IOException

      Same as `write(org.apache.http.nio.NHttpServerConnection, org.apache.http.nio.ContentEncoder)` but gives out the data consumed through the Pipe
      Parameters:
        `conn` - connection
        `encoder` - encoder
      Returns:
        data consumed
      Throws:
        `java.io.IOException` - if an error occurs

    - #### addHeader

          public void addHeader(java.lang.String name,
                                java.lang.String value)

    - #### setStatus

          public void setStatus(int status)

    - #### removeHeader

          public void removeHeader(java.lang.String name)

    - #### getHeader

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

    - #### hasEntity

          public boolean hasEntity()

    - #### setKeepAlive

          public void setKeepAlive(boolean keepAlive)

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