public interface MessageBuilder
Modifier and Type | Method and Description |
---|---|
MessageBuilder |
addHeader(String key,
String value)
Adds a header.
|
Object |
getBodyAsObject()
Gets the body as an object.
|
InputStream |
getBodyAsStream()
Gets the body as a stream.
|
<T> T |
getBodyAsType(Class<T> clazz)
Retrieves the body information of the call out message as a particular type.
|
Headers |
getCombinedHeaders(HttpMessage pHttpMessage)
Retrieve all the headers.
|
String |
getHeader(String key)
Gets the specific header if it exists.
|
MessageBuilder |
ignoreAllRequestHeaders(boolean ignore)
Remove all the headers which are from client request message.
|
MessageBuilder |
withBodyAsObject(Object body)
Sets the output as an object such as an XMLNode, String or JSON.
|
MessageBuilder |
withBodyAsStream(InputStream body)
Sets the output of a body as an input stream.
|
MessageBuilder |
withHeader(String key,
String value)
Sets a header.
|
MessageBuilder |
withHeaders(Map<String,String> headers)
Sets multiple headers.Overwrite the value which is set by
addHeader(String, String) before in the invocation sequence. |
MessageBuilder |
withoutHeader(String key)
Send the message without this header.
|
MessageBuilder withBodyAsObject(Object body)
body
- Body<T> T getBodyAsType(Class<T> clazz)
T
- The type of the classclazz
- The classString getHeader(String key)
key
- The key pointing to the header valueMessageBuilder withBodyAsStream(InputStream body)
body
- BodyObject getBodyAsObject()
InputStream getBodyAsStream()
MessageBuilder withHeader(String key, String value)
addHeader(String, String)
before in the invocation sequence.key
- The key pointing to the header valuevalue
- Value of the headerMessageBuilder addHeader(String key, String value)
withHeader(String, String)
and withHeaders(Map)
later in
the invocation sequence.key
- The key pointing to the header valuevalue
- Value of the headerMessageBuilder withHeaders(Map<String,String> headers)
addHeader(String, String)
before in the invocation sequence.headers
- Map with multiple headersMessageBuilder withoutHeader(String key)
key
- header to remove from messageMessageBuilder ignoreAllRequestHeaders(boolean ignore)
ignore
- true to remove all request headers from message, false will be merged with others.Headers getCombinedHeaders(HttpMessage pHttpMessage)
pHttpMessage
- the httpMessage to include the headers from to see what is possibly sent out