org.apache.synapse.transport.passthru

## Class SourceRequest

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

-     public class SourceRequest
      extends java.lang.Object

  Represents a Http Request.

- - ### Constructor Summary

    Constructors
    Constructor and Description
    `SourceRequest(SourceConfiguration sourceConfiguration, org.apache.http.HttpRequest request, org.apache.http.nio.NHttpServerConnection conn)`

  - ### 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.NHttpServerConnection conn, org.apache.http.nio.ContentDecoder decoder)` Same as `read(org.apache.http.nio.NHttpServerConnection, org.apache.http.nio.ContentDecoder)` but gives the copy of content produced in to the pipe.
    `org.apache.http.nio.NHttpServerConnection` | `getConnection()`
    `java.util.Map` | `getExcessHeaders()`
    `java.util.Map<java.lang.String,java.lang.String>` | `getHeaders()`
    `java.lang.String` | `getMethod()`
    `Pipe` | `getPipe()`
    `org.apache.http.HttpRequest` | `getRequest()`
    `java.lang.String` | `getUri()`
    `org.apache.http.ProtocolVersion` | `getVersion()`
    `boolean` | `isEntityEnclosing()`
    `int` | `read(org.apache.http.nio.NHttpServerConnection conn, org.apache.http.nio.ContentDecoder decoder)` Produce the content in to the pipe.
    `void` | `start(org.apache.http.nio.NHttpServerConnection conn)` Start processing the request by connecting the pipe if this request has an entity body.

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

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

- - ### Constructor Detail

    - #### SourceRequest

          public SourceRequest(SourceConfiguration sourceConfiguration,
                               org.apache.http.HttpRequest request,
                               org.apache.http.nio.NHttpServerConnection conn)

  - ### Method Detail

    - #### start

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

      Start processing the request by connecting the pipe if this request has an entity body.
      Parameters:
        `conn` - connection
      Throws:
        `java.io.IOException` - if an error occurs
        `org.apache.http.HttpException` - if an error occurs

    - #### read

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

      Produce the content in to the pipe.
      Parameters:
        `conn` - the connection
        `decoder` - content decoder
      Returns:
        number of bytes read
      Throws:
        `java.io.IOException` - if an error occurs

    - #### copyAndRead

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

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

    - #### getHeaders

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

    - #### getUri

          public java.lang.String getUri()

    - #### getMethod

          public java.lang.String getMethod()

    - #### getExcessHeaders

          public java.util.Map getExcessHeaders()

    - #### addExcessHeader

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

    - #### getPipe

          public Pipe getPipe()

    - #### getConnection

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

    - #### getVersion

          public org.apache.http.ProtocolVersion getVersion()

    - #### getRequest

          public org.apache.http.HttpRequest getRequest()

    - #### isEntityEnclosing

          public boolean isEntityEnclosing()

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