public class HttpCarbonMessage extends Object
| Modifier and Type | Field and Description |
|---|---|
protected io.netty.handler.codec.http.HttpMessage |
httpMessage |
ListenerReqRespStateManager |
listenerReqRespStateManager |
| Constructor and Description |
|---|
HttpCarbonMessage(io.netty.handler.codec.http.HttpMessage httpMessage) |
HttpCarbonMessage(io.netty.handler.codec.http.HttpMessage httpMessage,
int maxWaitTime,
Listener contentListener) |
HttpCarbonMessage(io.netty.handler.codec.http.HttpMessage httpMessage,
Listener contentListener) |
| Modifier and Type | Method and Description |
|---|---|
void |
addHttpContent(io.netty.handler.codec.http.HttpContent httpContent)
Add http content to HttpCarbonMessage.
|
void |
addMessageBody(ByteBuffer msgBody)
Deprecated.
|
HttpCarbonMessage |
cloneCarbonMessageWithOutData()
Copy Message properties and transport headers.
|
void |
completeMessage() |
long |
countMessageLengthTill(long maxLength)
Count the message length till the given message length and returns.
|
EntityCollector |
getBlockingEntityCollector() |
FullHttpMessageFuture |
getFullHttpCarbonMessage()
Returns the
FullHttpMessageFuture which notifies FullHttpMessageListener when the complete
content of the HttpCarbonMessage is accumulated. |
long |
getFullMessageLength()
Deprecated.
|
String |
getHeader(String key)
Return the value of the given header name.
|
io.netty.handler.codec.http.HttpHeaders |
getHeaders()
Returns the header map of the request.
|
Http2MessageStateContext |
getHttp2MessageStateContext() |
io.netty.handler.codec.http.HttpContent |
getHttpContent()
Get the available content of HttpCarbonMessage.
|
MessageFuture |
getHttpContentAsync() |
String |
getHttpMethod() |
HttpResponseFuture |
getHttpOutboundRespStatusFuture()
Returns the future responsible for notifying the response status.
|
ServerConnectorFuture |
getHttpResponseFuture()
Returns the future responsible for sending back the response.
|
Integer |
getHttpStatusCode() |
String |
getHttpVersion() |
IOException |
getIoException() |
Listener |
getListener() |
io.netty.buffer.ByteBuf |
getMessageBody()
Deprecated.
|
io.netty.handler.codec.http.HttpRequest |
getNettyHttpRequest()
Gives the underling netty request message.
|
io.netty.handler.codec.http.HttpResponse |
getNettyHttpResponse()
Gives the underling netty response message.
|
HttpPipeliningFuture |
getPipeliningFuture() |
Map<String,Object> |
getProperties() |
Object |
getProperty(String key) |
String |
getReasonPhrase() |
String |
getRequestUrl() |
long |
getSequenceId() |
io.netty.channel.ChannelHandlerContext |
getSourceContext() |
io.netty.channel.ChannelHandlerContext |
getTargetContext() |
io.netty.handler.codec.http.HttpHeaders |
getTrailerHeaders()
Returns the trailer header map of the message.
|
boolean |
is100ContinueExpected()
Can be used to detect if a request is expecting 100 continue.
|
boolean |
isEmpty()
Check if the payload empty.
|
boolean |
isKeepAlive() |
boolean |
isPassthrough()
The passthrough(when message body is not built) status of the message.
|
boolean |
isPipeliningEnabled() |
boolean |
isStreaming() |
void |
notifyContentFailure(Exception exception)
Notifies
FullHttpMessageListener if the content accumulation fails. |
HttpResponseFuture |
pushPromise(Http2PushPromise pushPromise)
Sends a push promise message back to the client.
|
HttpResponseFuture |
pushResponse(HttpCarbonMessage httpCarbonMessage,
Http2PushPromise pushPromise)
Sends a push response message back to the client.
|
void |
removeHeader(String key)
Remove the header using header name.
|
void |
removeInboundContentListener()
Removes the content listener that is set for handling inbound throttling in case of HTTP/1.1.
|
void |
removeMessageFuture() |
void |
removeProperty(String key) |
HttpResponseFuture |
respond(HttpCarbonMessage httpCarbonMessage) |
void |
setHeader(String key,
Object value)
Set the header value for the given name.
|
void |
setHeader(String key,
String value)
Set the header value for the given name.
|
void |
setHeaders(io.netty.handler.codec.http.HttpHeaders httpHeaders)
Let you set a set of headers.
|
void |
setHttp2MessageStateContext(Http2MessageStateContext http2MessageStateContext) |
void |
setHttpMethod(String httpMethod) |
void |
setHttpStatusCode(Integer httpStatusCode) |
void |
setHttpVersion(String httpVersion) |
void |
setIoException(IOException ioException) |
void |
setKeepAlive(boolean keepAlive) |
void |
setLastHttpContentArrived()
Sets the lastHttpContentArrived flag true upon the last HTTP content arrival and notifies the
FullHttpMessageFuture if available. |
void |
setPassthrough(boolean passthrough)
This value is to be set when sending the message to the consumer without building/processing it in the
application layer.
|
void |
setPipeliningEnabled(boolean pipeliningEnabled) |
void |
setPipeliningFuture(HttpPipeliningFuture pipeliningFuture)
Sets the pipelining future to the outbound response.
|
void |
setProperty(String key,
Object value) |
void |
setRequestUrl(String requestUrl) |
void |
setSequenceId(long sequenceId) |
void |
setSourceContext(io.netty.channel.ChannelHandlerContext sourceContext)
Set the source context.
|
void |
setStreaming(boolean streaming) |
void |
setTargetContext(io.netty.channel.ChannelHandlerContext targetContext) |
void |
waitAndReleaseAllEntities()
Wait till the entire payload is received.
|
protected io.netty.handler.codec.http.HttpMessage httpMessage
public ListenerReqRespStateManager listenerReqRespStateManager
public HttpCarbonMessage(io.netty.handler.codec.http.HttpMessage httpMessage,
Listener contentListener)
public HttpCarbonMessage(io.netty.handler.codec.http.HttpMessage httpMessage,
int maxWaitTime,
Listener contentListener)
public HttpCarbonMessage(io.netty.handler.codec.http.HttpMessage httpMessage)
public void addHttpContent(io.netty.handler.codec.http.HttpContent httpContent)
httpContent - chunks of the payload.public io.netty.handler.codec.http.HttpContent getHttpContent()
public MessageFuture getHttpContentAsync()
@Deprecated public io.netty.buffer.ByteBuf getMessageBody()
public boolean isEmpty()
public long countMessageLengthTill(long maxLength)
throws IllegalStateException
maxLength - is the maximum length to countIllegalStateException - if illegal state occurs in the absence of content@Deprecated public long getFullMessageLength()
@Deprecated public void addMessageBody(ByteBuffer msgBody)
msgBody - the message body.public void completeMessage()
public io.netty.handler.codec.http.HttpHeaders getHeaders()
public String getHeader(String key)
key - name of the header.public void setHeader(String key, String value)
key - header name.value - header value.public void setHeader(String key, Object value)
key - header name.value - header value as object.public void setHeaders(io.netty.handler.codec.http.HttpHeaders httpHeaders)
httpHeaders - set of headers that needs to be set.public void removeHeader(String key)
key - header name.public io.netty.handler.codec.http.HttpHeaders getTrailerHeaders()
public void removeMessageFuture()
public void removeProperty(String key)
public String getHttpVersion()
public void setHttpVersion(String httpVersion)
public String getHttpMethod()
public void setHttpMethod(String httpMethod)
public String getRequestUrl()
public void setRequestUrl(String requestUrl)
public Integer getHttpStatusCode()
public void setHttpStatusCode(Integer httpStatusCode)
public String getReasonPhrase()
public ServerConnectorFuture getHttpResponseFuture()
public HttpResponseFuture getHttpOutboundRespStatusFuture()
public HttpResponseFuture respond(HttpCarbonMessage httpCarbonMessage) throws ServerConnectorException
ServerConnectorExceptionpublic HttpResponseFuture pushResponse(HttpCarbonMessage httpCarbonMessage, Http2PushPromise pushPromise) throws ServerConnectorException
httpCarbonMessage - the push response messagepushPromise - the push promise associated with the push response messageServerConnectorException - if there is an error occurs while doing the operationpublic HttpResponseFuture pushPromise(Http2PushPromise pushPromise) throws ServerConnectorException
pushPromise - the push promise messageServerConnectorException - if there is an error occurs while doing the operationpublic HttpCarbonMessage cloneCarbonMessageWithOutData()
public void waitAndReleaseAllEntities()
public EntityCollector getBlockingEntityCollector()
public io.netty.handler.codec.http.HttpRequest getNettyHttpRequest()
public io.netty.handler.codec.http.HttpResponse getNettyHttpResponse()
public IOException getIoException()
public void setIoException(IOException ioException)
public Http2MessageStateContext getHttp2MessageStateContext()
public void setHttp2MessageStateContext(Http2MessageStateContext http2MessageStateContext)
public long getSequenceId()
public void setSequenceId(long sequenceId)
public io.netty.channel.ChannelHandlerContext getSourceContext()
public void setSourceContext(io.netty.channel.ChannelHandlerContext sourceContext)
sourceContext - represent the source contextpublic boolean isKeepAlive()
public void setKeepAlive(boolean keepAlive)
public boolean isPipeliningEnabled()
public boolean isStreaming()
public void setStreaming(boolean streaming)
public boolean is100ContinueExpected()
public void setPipeliningEnabled(boolean pipeliningEnabled)
public HttpPipeliningFuture getPipeliningFuture()
public void setPipeliningFuture(HttpPipeliningFuture pipeliningFuture)
pipeliningFuture - Represents pipelining future which is used for binding pipelining listenerpublic void removeInboundContentListener()
public boolean isPassthrough()
public void setPassthrough(boolean passthrough)
passthrough - if the message is a passthrough.public void setTargetContext(io.netty.channel.ChannelHandlerContext targetContext)
targetContext - The target handler context.public io.netty.channel.ChannelHandlerContext getTargetContext()
public FullHttpMessageFuture getFullHttpCarbonMessage()
FullHttpMessageFuture which notifies FullHttpMessageListener when the complete
content of the HttpCarbonMessage is accumulated. Should never remove content listener for HTTP/2.FullHttpMessageFuture.public void setLastHttpContentArrived()
FullHttpMessageFuture if available.public void notifyContentFailure(Exception exception)
FullHttpMessageListener if the content accumulation fails.exception - of content accumulationpublic Listener getListener()
Copyright © 2021 WSO2. All rights reserved.