public interface ZuulMessage
extends java.lang.Cloneable
Modifier and Type | Method and Description |
---|---|
void |
bufferBodyContents(io.netty.handler.codec.http.HttpContent chunk)
Appends an HTTP content chunk to this message.
|
ZuulMessage |
clone()
Returns a copy of this message.
|
void |
disposeBufferedBody()
Clears the content chunks of this body, calling
release() in the process. |
boolean |
finishBufferedBodyIfIncomplete()
Sets the message body to be complete if it was not already so.
|
byte[] |
getBody()
Returns the message body.
|
java.lang.String |
getBodyAsText()
Gets the body of this message as UTF-8 text, or
null if there is no body. |
java.lang.Iterable<io.netty.handler.codec.http.HttpContent> |
getBodyContents()
Returns the HTTP content chunks that are part of this message.
|
int |
getBodyLength()
Returns the length of the message body, or
0 if there isn't a message present. |
SessionContext |
getContext()
Returns the session context of this message.
|
Headers |
getHeaders()
Returns the headers for this message.
|
java.lang.String |
getInfoForLogging()
Returns a string that reprsents this message which is suitable for debugging.
|
int |
getMaxBodySize()
Returns the maximum body size that this message is willing to hold.
|
boolean |
hasBody()
Returns if this message has an attached body.
|
boolean |
hasCompleteBody()
Indicates that the message contains a content chunk the implements
LastHttpContent . |
void |
runBufferedBodyContentThroughFilter(ZuulFilter<?,?> filter)
Passes the body content chunks through the given filter, and sets them back into this message.
|
void |
setBody(byte[] body)
Sets the message body.
|
void |
setBodyAsText(java.lang.String bodyText)
Sets the message body as UTF-8 encoded text.
|
void |
setHasBody(boolean hasBody)
Declares that this message has a body.
|
void |
setHeaders(Headers newHeaders)
Sets the headers for this message.
|
SessionContext getContext()
Headers getHeaders()
null
default headers value will be returned.void setHeaders(Headers newHeaders)
java.lang.NullPointerException
- if newHeaders is null
.boolean hasBody()
void setHasBody(boolean hasBody)
bufferBodyContents(io.netty.handler.codec.http.HttpContent)
is invoked.@Nullable byte[] getBody()
null
.int getBodyLength()
0
if there isn't a message present.void setBody(@Nullable byte[] body)
body
is null
, this may not reset the body presence as
returned by hasBody()
. The body is considered complete after calling this method.void setBodyAsText(@Nullable java.lang.String bodyText)
void bufferBodyContents(io.netty.handler.codec.http.HttpContent chunk)
LastHttpContent
.java.lang.NullPointerException
- if chunk
is null
.java.lang.Iterable<io.netty.handler.codec.http.HttpContent> getBodyContents()
boolean finishBufferedBodyIfIncomplete()
true
if the body was not yet complete, or else false.boolean hasCompleteBody()
LastHttpContent
.void runBufferedBodyContentThroughFilter(ZuulFilter<?,?> filter)
void disposeBufferedBody()
release()
in the process. Users SHOULD call this method
when the body content is no longer needed.@Nullable java.lang.String getBodyAsText()
null
if there is no body.int getMaxBodySize()
ZuulMessage clone()
java.lang.String getInfoForLogging()