public interface ChunkResponseParser<H extends ChunkHeader,ROW extends ChunkRow,T extends ChunkTrailer>
Modifier and Type | Method and Description |
---|---|
void |
cleanup()
Releases resources managed by the parser and prepares it for reuse.
|
Optional<CouchbaseException> |
decodingFailure()
If the parser fails due to malformed input the cause is returned here.
|
void |
endOfInput()
Indicates the complete JSON document has been fed to the parser.
|
Optional<CouchbaseException> |
error()
If the parser sees an error, it should fill this optional so that if the IO
layer needs to fail the topmost future it will be passed in.
|
void |
feed(com.couchbase.client.core.deps.io.netty.buffer.ByteBuf input)
Parses the given JSON document fragment.
|
Optional<H> |
header()
Once the header is completely available, returns a non-absent value of it.
|
void |
initialize(com.couchbase.client.core.deps.io.netty.channel.ChannelConfig channelConfig)
Begins a new parsing session.
|
Flux<ROW> |
rows()
Returns the currently assigned flux for the rows.
|
Mono<T> |
trailer()
Returns the currently assigned mono for the trailer bits.
|
void |
updateRequestContext(RequestContext requestContext)
Sets the request context for the current request in the parser, can be used for error handling.
|
void |
updateResponseHeader(com.couchbase.client.core.deps.io.netty.handler.codec.http.HttpResponse responseHeader)
Sets the current response header if present.
|
Optional<H> header()
It is important to provide a non-absent value even if some parts are optional because the related IO components will only proceed if a header is available eventually.
Optional<CouchbaseException> error()
Optional<CouchbaseException> decodingFailure()
void initialize(com.couchbase.client.core.deps.io.netty.channel.ChannelConfig channelConfig)
channelConfig
- the channel config used for backpressure auto-read.void cleanup()
void feed(com.couchbase.client.core.deps.io.netty.buffer.ByteBuf input)
void endOfInput()
void updateRequestContext(RequestContext requestContext)
void updateResponseHeader(com.couchbase.client.core.deps.io.netty.handler.codec.http.HttpResponse responseHeader)
Copyright © 2020 Couchbase, Inc.. All rights reserved.