public class BlockingEntityCollector extends Object implements EntityCollector
| Modifier and Type | Method and Description |
|---|---|
void |
addHttpContent(io.netty.handler.codec.http.HttpContent httpContent)
Add httpContent to the queue.
|
void |
addMessageBody(ByteBuffer msgBody)
Add the ByteBuffer version the httpContent to the queue.
|
void |
completeMessage()
Complete the message.
|
long |
countMessageLengthTill(long maxSize)
Count the message length till the given message length and returns.
|
long |
getFullMessageLength()
Get the full message length
|
io.netty.handler.codec.http.HttpContent |
getHttpContent()
Get the first httpContent from the queue.
|
io.netty.buffer.ByteBuf |
getMessageBody()
Get the first ByteBuffer version of the HttpContent from the queue.
|
boolean |
isEmpty()
Check if the queue is empty.
|
void |
waitAndReleaseAllEntities()
This is need to release content before GC
|
public void addHttpContent(io.netty.handler.codec.http.HttpContent httpContent)
EntityCollectoraddHttpContent in interface EntityCollectorhttpContent - httpContentpublic void addMessageBody(ByteBuffer msgBody)
EntityCollectoraddMessageBody in interface EntityCollectormsgBody - ByteBuffer version of the httpContent.public io.netty.handler.codec.http.HttpContent getHttpContent()
EntityCollectorgetHttpContent in interface EntityCollectorpublic io.netty.buffer.ByteBuf getMessageBody()
EntityCollectorgetMessageBody in interface EntityCollectorpublic long getFullMessageLength()
EntityCollectorgetFullMessageLength in interface EntityCollectorpublic long countMessageLengthTill(long maxSize)
throws IllegalStateException
EntityCollectorcountMessageLengthTill in interface EntityCollectormaxSize - is the maximum length to countIllegalStateException - if illegal state occurs in the absence of contentpublic void waitAndReleaseAllEntities()
EntityCollectorwaitAndReleaseAllEntities in interface EntityCollectorpublic boolean isEmpty()
EntityCollectorisEmpty in interface EntityCollectorpublic void completeMessage()
EntityCollectorcompleteMessage in interface EntityCollectorCopyright © 2022 WSO2. All rights reserved.