org.apache.tinkerpop.gremlin.driver

## Class Client.SessionedClient

- java.lang.Object
- - org.apache.tinkerpop.gremlin.driver.Client
  - - org.apache.tinkerpop.gremlin.driver.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.

- - ### Nested Class Summary

    - ### Nested classes/interfaces inherited from class org.apache.tinkerpop.gremlin.driver.Client

      `Client.AliasClusteredClient, Client.ClusteredClient, Client.SessionedClient, Client.SessionSettings, Client.Settings`

  - ### Field Summary

    - ### Fields inherited from class org.apache.tinkerpop.gremlin.driver.Client

      `cluster, initialized, settings`

  - ### Method Summary

    All Methods Instance Methods Concrete Methods
    Modifier and Type | Method and Description
    --- | ---
    `RequestMessage.Builder` | `buildMessage(RequestMessage.Builder builder)` Adds the `Tokens.ARGS_SESSION` value to every `RequestMessage`.
    `protected org.apache.tinkerpop.gremlin.driver.Connection` | `chooseConnection(RequestMessage msg)` Since the session is bound to a single host, simply borrow a connection from that pool.
    `CompletableFuture<Void>` | `closeAsync()` Close the bound `ConnectionPool`.
    `protected void` | `initializeImplementation()` Randomly choose an available `Host` to bind the session too and initialize the `ConnectionPool`.
    `boolean` | `isClosing()`

    - ### Methods inherited from class org.apache.tinkerpop.gremlin.driver.Client

      `alias, alias, close, getCluster, getSettings, init, makeDefaultAliasMap, submit, submit, submit, submit, submit, submit, submitAsync, submitAsync, submitAsync, submitAsync, submitAsync, submitAsync, submitAsync, submitAsync, submitAsync`

    - ### Methods inherited from class java.lang.Object

      `clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait`

- - ### Method Detail

    - #### buildMessage

          public RequestMessage.Builder buildMessage(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(RequestMessage msg)
                                                                             throws TimeoutException,
                                                                                    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`
        `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`

    - #### closeAsync

          public CompletableFuture<Void> closeAsync()

      Close the bound `ConnectionPool`.
      Specified by:
        `closeAsync` in class `Client`

Copyright © 2013–2020 Apache Software Foundation. All rights reserved.