Class ViewChunkResponseParser
- java.lang.Object
-
- com.couchbase.client.core.io.netty.chunk.BaseChunkResponseParser<ViewChunkHeader,ViewChunkRow,ViewChunkTrailer>
-
- com.couchbase.client.core.io.netty.view.ViewChunkResponseParser
-
- All Implemented Interfaces:
ChunkResponseParser<ViewChunkHeader,ViewChunkRow,ViewChunkTrailer>
public class ViewChunkResponseParser extends BaseChunkResponseParser<ViewChunkHeader,ViewChunkRow,ViewChunkTrailer>
Parses the individual response http chunks for a view request.
-
-
Constructor Summary
Constructors Constructor Description ViewChunkResponseParser()
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description protected voiddoCleanup()Give subclasses a chance to reset their state.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.Optional<ViewChunkHeader>header(boolean lastChunk)Once the header is completely available, returns a non-absent value of it.protected JsonStreamParser.BuilderparserBuilder()Subclass implements this to return the "meat" of the decoding, the chunk parser.voidsignalComplete()Called when the JSON stream has been parsed completely and successfully.-
Methods inherited from class com.couchbase.client.core.io.netty.chunk.BaseChunkResponseParser
cleanup, completeRows, completeTrailer, decodingFailure, emitRow, endOfInput, failRows, feed, initialize, isHeaderComplete, markHeaderComplete, requestContext, responseHeader, rows, trailer, updateRequestContext, updateResponseHeader
-
-
-
-
Method Detail
-
parserBuilder
protected JsonStreamParser.Builder parserBuilder()
Description copied from class:BaseChunkResponseParserSubclass implements this to return the "meat" of the decoding, the chunk parser.- Specified by:
parserBuilderin classBaseChunkResponseParser<ViewChunkHeader,ViewChunkRow,ViewChunkTrailer>
-
doCleanup
protected void doCleanup()
Description copied from class:BaseChunkResponseParserGive subclasses a chance to reset their state.- Specified by:
doCleanupin classBaseChunkResponseParser<ViewChunkHeader,ViewChunkRow,ViewChunkTrailer>
-
header
public Optional<ViewChunkHeader> header(boolean lastChunk)
Description copied from interface:ChunkResponseParserOnce the header is completely available, returns a non-absent value of it.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.
- Parameters:
lastChunk- if we are currently parsing the last chunk.
-
error
public Optional<CouchbaseException> error()
Description copied from interface:ChunkResponseParserIf 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.
-
signalComplete
public void signalComplete()
Description copied from class:BaseChunkResponseParserCalled when the JSON stream has been parsed completely and successfully.- Specified by:
signalCompletein classBaseChunkResponseParser<ViewChunkHeader,ViewChunkRow,ViewChunkTrailer>
-
-