Class Client.SessionedClient

  • Enclosing class:
    Client

    public static final class Client.SessionedClient
    extends Client
    A Client implementation that operates in the context of a session. Requests are sent to a single server, where each request is bound to the same thread with the same set of bindings across requests. Transaction are not automatically committed. It is up the client to issue commit/rollback commands.
    • Method Detail

      • getSessionId

        public String getSessionId()
        Returns the session identifier bound to this Client.
      • buildMessage

        public org.apache.tinkerpop.gremlin.driver.message.RequestMessage.Builder buildMessage​(org.apache.tinkerpop.gremlin.driver.message.RequestMessage.Builder builder)
        Adds the Tokens.ARGS_SESSION value to every RequestMessage.
        Overrides:
        buildMessage in class Client
      • chooseConnection

        protected org.apache.tinkerpop.gremlin.driver.Connection chooseConnection​(org.apache.tinkerpop.gremlin.driver.message.RequestMessage msg)
                                                                           throws TimeoutException,
                                                                                  org.apache.tinkerpop.gremlin.driver.exception.ConnectionException
        Since the session is bound to a single host, simply borrow a connection from that pool.
        Specified by:
        chooseConnection in class Client
        Throws:
        TimeoutException
        org.apache.tinkerpop.gremlin.driver.exception.ConnectionException
      • initializeImplementation

        protected void initializeImplementation()
        Randomly choose an available Host to bind the session too and initialize the ConnectionPool.
        Specified by:
        initializeImplementation in class Client
      • isClosing

        public boolean isClosing()
        Specified by:
        isClosing in class Client