public class YasjlQueryResponseParser extends Object
A N1QL/Query response parser, based on yasjl.
Constructor and Description |
---|
YasjlQueryResponseParser(rx.Scheduler scheduler,
long ttl)
Create a new
YasjlQueryResponseParser . |
Modifier and Type | Method and Description |
---|---|
void |
finishParsingAndReset()
Instruct the parser to finish the parsing and reset its internal state, turning it back to uninitialized as well.
|
void |
initialize(ByteBuf responseContent,
ResponseStatus responseStatus,
CouchbaseRequest request)
Initialize this parser for a response parsing cycle.
|
boolean |
isInitialized()
True if this parser is currently initialized and ready to parse a response.
|
GenericQueryResponse |
parse()
Instruct the parser to run a new parsing cycle on the current response content.
|
public YasjlQueryResponseParser(rx.Scheduler scheduler, long ttl)
Create a new YasjlQueryResponseParser
.
scheduler
- the scheduler which should be used when computations are moved out.ttl
- the ttl used for the subjects until their contents are garbage collected.public boolean isInitialized()
True if this parser is currently initialized and ready to parse a response.
public void initialize(ByteBuf responseContent, ResponseStatus responseStatus, CouchbaseRequest request)
Initialize this parser for a response parsing cycle.
responseContent
- the raw content to parse from.responseStatus
- the status of the response.request
- the original request.public GenericQueryResponse parse() throws Exception
Instruct the parser to run a new parsing cycle on the current response content.
GenericQueryResponse
if ready, null otherwise.Exception
- if the internal parsing can’t complete.public void finishParsingAndReset()
Instruct the parser to finish the parsing and reset its internal state, turning it back to uninitialized as well.
Copyright © 2017 Couchbase, Inc.. All rights reserved.