public class TargetRequest extends Object
Constructor and Description |
---|
TargetRequest(TargetConfiguration targetConfiguration,
org.apache.http.conn.routing.HttpRoute route,
String method,
URL url,
boolean hasEntityBody) |
TargetRequest(TargetConfiguration targetConfiguration,
org.apache.http.conn.routing.HttpRoute route,
URL url,
String method,
boolean hasEntityBody)
Create a target request.
|
Modifier and Type | Method and Description |
---|---|
void |
addHeader(String name,
String value) |
void |
connect(Pipe pipe) |
protected long |
getContentLength(org.apache.http.nio.NHttpClientConnection conn) |
protected org.apache.http.HttpRequest |
getHttpRequest(org.apache.http.nio.NHttpClientConnection conn,
String path,
boolean needToProcessChunking) |
String |
getMethod() |
Pipe |
getPipe() |
org.apache.http.HttpRequest |
getRequest() |
org.apache.http.conn.routing.HttpRoute |
getRoute() |
boolean |
hasEntityBody() |
void |
setChunk(boolean chunk) |
void |
setFullUrl(boolean fullUrl) |
void |
setHasEntityBody(boolean hasEntityBody) |
void |
setKeepAlive(boolean keepAlive) |
void |
setPort(int port) |
void |
setVersion(org.apache.http.ProtocolVersion version) |
void |
start(org.apache.http.nio.NHttpClientConnection conn) |
int |
write(org.apache.http.nio.NHttpClientConnection conn,
org.apache.http.nio.ContentEncoder encoder)
Consume the data from the pipe and write it to the wire.
|
public TargetRequest(TargetConfiguration targetConfiguration, org.apache.http.conn.routing.HttpRoute route, URL url, String method, boolean hasEntityBody)
targetConfiguration
- the configuration of the senderurl
- the url to be usedmethod
- the HTTP methodhasEntityBody
- weather request has an entity bodypublic TargetRequest(TargetConfiguration targetConfiguration, org.apache.http.conn.routing.HttpRoute route, String method, URL url, boolean hasEntityBody)
public void connect(Pipe pipe)
protected long getContentLength(org.apache.http.nio.NHttpClientConnection conn)
protected org.apache.http.HttpRequest getHttpRequest(org.apache.http.nio.NHttpClientConnection conn, String path, boolean needToProcessChunking)
public void start(org.apache.http.nio.NHttpClientConnection conn) throws IOException, org.apache.http.HttpException
IOException
org.apache.http.HttpException
public int write(org.apache.http.nio.NHttpClientConnection conn, org.apache.http.nio.ContentEncoder encoder) throws IOException
conn
- the connection to the targetencoder
- encoder for writing the message throughIOException
- if an error occurspublic boolean hasEntityBody()
public void setHasEntityBody(boolean hasEntityBody)
public String getMethod()
public void setChunk(boolean chunk)
public void setPort(int port)
public void setFullUrl(boolean fullUrl)
public void setVersion(org.apache.http.ProtocolVersion version)
public void setKeepAlive(boolean keepAlive)
public org.apache.http.HttpRequest getRequest()
public org.apache.http.conn.routing.HttpRoute getRoute()
public Pipe getPipe()
Copyright © 2005–2018 Apache Software Foundation. All rights reserved.