Class TargetResponse
java.lang.Object
org.apache.synapse.transport.passthru.TargetResponse
This class represents a response coming from the target server.
-
Constructor Summary
ConstructorsConstructorDescriptionTargetResponse(TargetConfiguration targetConfiguration, org.apache.http.HttpResponse response, org.apache.http.nio.NHttpClientConnection conn, boolean expectResponseBody, boolean forceShutdownConnectionOnComplete) -
Method Summary
Modifier and TypeMethodDescriptionvoidaddExcessHeader(org.apache.http.Header h) copyAndRead(org.apache.http.nio.NHttpClientConnection conn, org.apache.http.nio.ContentDecoder decoder) Same asread(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.NHttpClientConnectiongetPipe()intorg.apache.http.ProtocolVersionbooleanbooleanintread(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.voidstart(org.apache.http.nio.NHttpClientConnection conn) Starts the response
-
Constructor Details
-
TargetResponse
public TargetResponse(TargetConfiguration targetConfiguration, org.apache.http.HttpResponse response, org.apache.http.nio.NHttpClientConnection conn, boolean expectResponseBody, boolean forceShutdownConnectionOnComplete)
-
-
Method Details
-
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 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 connectiondecoder- content decoder- Returns:
- number of bites read
- Throws:
IOException- if an error occurs
-
copyAndRead
public ByteBuffer copyAndRead(org.apache.http.nio.NHttpClientConnection conn, org.apache.http.nio.ContentDecoder decoder) throws IOException Same asread(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 connectiondecoder- content decoder- Returns:
- data read
- Throws:
IOException- if an error occurs
-
getHeader
-
getHeaders
-
getExcessHeaders
-
addExcessHeader
public void addExcessHeader(org.apache.http.Header h) -
getPipe
-
getStatus
public int getStatus() -
getStatusLine
-
isExpectResponseBody
public boolean isExpectResponseBody() -
getConnection
public org.apache.http.nio.NHttpClientConnection getConnection() -
getVersion
public org.apache.http.ProtocolVersion getVersion() -
isForceShutdownConnectionOnComplete
public boolean isForceShutdownConnectionOnComplete()
-