Search in sources :

Example 1 with ResponseMessage

use of org.apache.tinkerpop.gremlin.driver.message.ResponseMessage in project cypher-for-gremlin by opencypher.

the class CypherOpProcessor method explainQuery.

private void explainQuery(Context context, CypherAstWrapper ast, String gremlin) {
    Map<String, Object> explanation = new LinkedHashMap<>();
    explanation.put("translation", gremlin);
    explanation.put("options", ast.getOptions().toString());
    ResponseMessage explainMsg = ResponseMessage.build(context.getRequestMessage()).code(ResponseStatusCode.SUCCESS).statusMessage("OK").result(singletonList(explanation)).create();
    ChannelHandlerContext ctx = context.getChannelHandlerContext();
    ctx.writeAndFlush(explainMsg);
}
Also used : ChannelHandlerContext(io.netty.channel.ChannelHandlerContext) ResponseMessage(org.apache.tinkerpop.gremlin.driver.message.ResponseMessage) LinkedHashMap(java.util.LinkedHashMap)

Aggregations

ChannelHandlerContext (io.netty.channel.ChannelHandlerContext)1 LinkedHashMap (java.util.LinkedHashMap)1 ResponseMessage (org.apache.tinkerpop.gremlin.driver.message.ResponseMessage)1