Class Context

java.lang.Object
org.apache.tinkerpop.gremlin.server.Context

public class Context extends Object
The context of Gremlin Server within which a particular request is made.
Author:
Stephen Mallette (http://stephen.genoprime.com)
  • Constructor Details

  • Method Details

    • setTimeoutExecutor

      public void setTimeoutExecutor(ScheduledFuture<?> timeoutExecutor)
    • getTimeoutExecutor

      public ScheduledFuture<?> getTimeoutExecutor()
    • getRequestTimeout

      public long getRequestTimeout()
      The timeout in milliseconds for the request. Resolved in the constructor (see the precedence note there).
    • getMaterializeProperties

      public String getMaterializeProperties()
    • getLanguage

      public String getLanguage()
      The language resolved for the request (see the precedence note in the constructor).
    • getBatchSize

      public int getBatchSize() throws ProcessingException
      The batch size resolved for the request, parsed to a positive int. Parsing happens here (rather than in the Context constructor) so that an invalid value - non-numeric, non-positive, or greater than Integer.MAX_VALUE - is surfaced as a bad request via ProcessingException rather than an uncaught error. Callers must be on a path that turns a ProcessingException into a response (i.e. before the 200 OK is committed).
      Throws:
      ProcessingException
    • getBulkResults

      public boolean getBulkResults()
      Whether results should be bulked for the request (see the precedence note in the constructor).
    • getScheduledExecutorService

      public ScheduledExecutorService getScheduledExecutorService()
    • getTransactionId

      public String getTransactionId()
    • isTransactionBegin

      public boolean isTransactionBegin()
      Returns true if this request is a transaction begin control command.
    • isTransactionCommit

      public boolean isTransactionCommit()
      Returns true if this request is a transaction commit control command.
    • isTransactionRollback

      public boolean isTransactionRollback()
      Returns true if this request is a transaction rollback control command.
    • setTransactionId

      public void setTransactionId(String transactionId)
    • setClosedByLifetimeCap

      public void setClosedByLifetimeCap(boolean closedByLifetimeCap)
      Marks this request's operation as having been interrupted because its transaction hit its absolute lifetime cap. Set by the transaction's lifetime cap before it interrupts the operation.
    • isClosedByLifetimeCap

      public boolean isClosedByLifetimeCap()
      Returns true if this request's operation was interrupted by its transaction's absolute lifetime cap, in which case the resulting interrupt should be reported as a transaction timeout rather than an evaluation timeout.
    • getParameters

      public Map<String,Object> getParameters()
    • setParameters

      public void setParameters(Map<String,Object> parameters)
    • getRequestMessage

      public RequestMessage getRequestMessage()
      Gets the current request to Gremlin Server.
    • getChannelHandlerContext

      public io.netty.channel.ChannelHandlerContext getChannelHandlerContext()
      Gets the Netty context.
    • getSettings

      public Settings getSettings()
      Gets the current configuration of Gremlin Server.
    • getGraphManager

      public GraphManager getGraphManager()
      Gets the set of Graph objects configured in Gremlin Server.
    • getGremlinExecutor

      public GremlinExecutor getGremlinExecutor()
      Gets the executor chosen to evaluate incoming Gremlin scripts based on the request.
    • handleDetachment

      public void handleDetachment(List<Object> aggregate)