public class NettyClient extends Object
| Modifier and Type | Field and Description |
|---|---|
static String |
PROTOCOL |
static String |
RESPONSE_CODE |
static String |
RESPONSE_CODE_MESSAGE |
static String |
RESPONSE_HEADERS |
| Constructor and Description |
|---|
NettyClient(Marshaller marshaller,
UnMarshaller unmarshaller)
Construct a Netty client with the provided marshaller/unmarshaller.
|
| Modifier and Type | Method and Description |
|---|---|
Integer |
getChunkSize() |
Object |
invoke(Object reqMessage,
String targetAddress,
boolean oneway,
Map<String,Object> additionalHeaders,
Map<String,Object> callProps)
Performs the invocation; a HTTP GET is performed when the reqMessage is null, otherwise a HTTP POST is performed.
|
protected void |
setActualChunkedLength(org.jboss.netty.handler.codec.http.HttpRequest message,
Map<String,Object> callProps)
Set the actual chunk size according to the endpoint config overwrite and/or configured features.
|
protected void |
setActualTimeout(Map<String,Object> callProps)
Set the actual timeout according to specified caller properties
|
protected void |
setAdditionalHeaders(org.jboss.netty.handler.codec.http.HttpMessage message,
Map<String,Object> headers)
Copy the provided additional headers to the Netty's HttpMessage.
|
protected void |
setAuthorization(org.jboss.netty.handler.codec.http.HttpMessage message,
Map<String,Object> callProps)
Set the required headers in the Netty's HttpMessage to allow for proper authorization.
|
void |
setChunkSize(Integer chunkSize)
Set the chunk size for chunked transfer encoding.
|
public static final String RESPONSE_CODE
public static final String RESPONSE_CODE_MESSAGE
public static final String PROTOCOL
public static final String RESPONSE_HEADERS
public NettyClient(Marshaller marshaller, UnMarshaller unmarshaller)
marshaller - unmarshaller - public Object invoke(Object reqMessage, String targetAddress, boolean oneway, Map<String,Object> additionalHeaders, Map<String,Object> callProps) throws IOException
reqMessage - The request messagetargetAddress - The target addressoneway - True for one-way message exchanges
and when maintaining sessions using cookies.additionalHeaders - Additional http headers to be added to the requestcallProps - IOExceptionprotected void setActualChunkedLength(org.jboss.netty.handler.codec.http.HttpRequest message,
Map<String,Object> callProps)
message - protected void setActualTimeout(Map<String,Object> callProps)
callProps - protected void setAuthorization(org.jboss.netty.handler.codec.http.HttpMessage message,
Map<String,Object> callProps)
throws IOException
message - callProps - IOExceptionprotected void setAdditionalHeaders(org.jboss.netty.handler.codec.http.HttpMessage message,
Map<String,Object> headers)
message - headers - public Integer getChunkSize()
public void setChunkSize(Integer chunkSize)
chunkSize - Copyright © 2012 JBoss, by Red Hat. All Rights Reserved.