Class SourceRequest
java.lang.Object
org.apache.synapse.transport.passthru.SourceRequest
Represents a Http Request.
-
Constructor Summary
ConstructorsConstructorDescriptionSourceRequest(SourceConfiguration sourceConfiguration, org.apache.http.HttpRequest request, org.apache.http.nio.NHttpServerConnection conn) -
Method Summary
Modifier and TypeMethodDescriptionvoidaddExcessHeader(org.apache.http.Header h) copyAndRead(org.apache.http.nio.NHttpServerConnection conn, org.apache.http.nio.ContentDecoder decoder) Same asread(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.NHttpServerConnectiongetPipe()org.apache.http.HttpRequestgetUri()org.apache.http.ProtocolVersionbooleanintread(org.apache.http.nio.NHttpServerConnection conn, org.apache.http.nio.ContentDecoder decoder) Produce the content in to the pipe.voidstart(org.apache.http.nio.NHttpServerConnection conn) Start processing the request by connecting the pipe if this request has an entity body.
-
Constructor Details
-
SourceRequest
public SourceRequest(SourceConfiguration sourceConfiguration, org.apache.http.HttpRequest request, org.apache.http.nio.NHttpServerConnection conn)
-
-
Method Details
-
start
public void start(org.apache.http.nio.NHttpServerConnection conn) throws IOException, org.apache.http.HttpException Start processing the request by connecting the pipe if this request has an entity body.- Parameters:
conn- connection- Throws:
IOException- if an error occursorg.apache.http.HttpException- if an error occurs
-
read
public int read(org.apache.http.nio.NHttpServerConnection conn, org.apache.http.nio.ContentDecoder decoder) throws IOException Produce the content in to the pipe.- Parameters:
conn- the connectiondecoder- content decoder- Returns:
- number of bytes read
- Throws:
IOException- if an error occurs
-
copyAndRead
public ByteBuffer copyAndRead(org.apache.http.nio.NHttpServerConnection conn, org.apache.http.nio.ContentDecoder decoder) throws IOException Same asread(org.apache.http.nio.NHttpServerConnection, org.apache.http.nio.ContentDecoder)but gives the copy of content produced in to the pipe.- Parameters:
conn- the connectiondecoder- content decoder- Returns:
- copy of data produced to the pipe
- Throws:
IOException- if an error occurs
-
getHeaders
-
getUri
-
getMethod
-
getExcessHeaders
-
addExcessHeader
public void addExcessHeader(org.apache.http.Header h) -
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()
-