Class YasjlQueryResponseParser
java.lang.Object
com.couchbase.client.core.endpoint.query.parser.YasjlQueryResponseParser
public class YasjlQueryResponseParser extends Object
A N1QL/Query response parser, based on yasjl.
- Since:
- 1.4.3
- Author:
- Subhashni Balakrishnan, Michael Nitschinger
-
Constructor Summary
Constructors Constructor Description YasjlQueryResponseParser(rx.Scheduler scheduler, long ttl, CoreEnvironment env)
Create a newYasjlQueryResponseParser
. -
Method Summary
Modifier and Type Method 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.
-
Constructor Details
-
YasjlQueryResponseParser
Create a newYasjlQueryResponseParser
.- Parameters:
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.
-
-
Method Details
-
isInitialized
public boolean isInitialized()True if this parser is currently initialized and ready to parse a response.- Returns:
- true if initialized, false otherwise.
-
initialize
public void initialize(ByteBuf responseContent, ResponseStatus responseStatus, CouchbaseRequest request)Initialize this parser for a response parsing cycle.- Parameters:
responseContent
- the raw content to parse from.responseStatus
- the status of the response.request
- the original request.
-
parse
Instruct the parser to run a new parsing cycle on the current response content.- Returns:
- the
GenericQueryResponse
if ready, null otherwise. - Throws:
Exception
- if the internal parsing can't complete.
-
finishParsingAndReset
public void finishParsingAndReset()Instruct the parser to finish the parsing and reset its internal state, turning it back to uninitialized as well.
-