Class Session
- java.lang.Object
-
- org.apache.tinkerpop.gremlin.server.op.session.Session
-
public class Session extends Object
Defines a "session" for theSessionOpProcessorwhich preserves state between requests made to Gremlin Server. Since transactions are bound to a single thread the "session" maintains its own thread to process Gremlin statements so that each request can be executed within it to preserve the transaction state from one request to the next.- Author:
- Stephen Mallette (http://stephen.genoprime.com)
-
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description booleanacceptingRequests()BindingsgetBindings()ExecutorServicegetExecutor()GremlinExecutorgetGremlinExecutor()StringgetSessionId()booleanisBoundTo(io.netty.channel.Channel channel)Determines if the suppliedChannelobject is the same as the one bound to theSession.voidkill(boolean force)Kills the session and rollback any uncommitted changes on transactional graphs.voidmanualKill(boolean force)Stops the session with call tokill(boolean)but also stops the session expiration call which ensures that the session is only killed once.voidtouch()
-
-
-
Constructor Detail
-
Session
public Session(String session, Context context, ConcurrentHashMap<String,Session> sessions)
-
-
Method Detail
-
isBoundTo
public boolean isBoundTo(io.netty.channel.Channel channel)
Determines if the suppliedChannelobject is the same as the one bound to theSession.
-
getGremlinExecutor
public GremlinExecutor getGremlinExecutor()
-
getBindings
public Bindings getBindings()
-
getExecutor
public ExecutorService getExecutor()
-
getSessionId
public String getSessionId()
-
acceptingRequests
public boolean acceptingRequests()
-
touch
public void touch()
-
manualKill
public void manualKill(boolean force)
Stops the session with call tokill(boolean)but also stops the session expiration call which ensures that the session is only killed once. Seekill(boolean)for information on how what "forcing" the session kill will mean.
-
kill
public void kill(boolean force)
Kills the session and rollback any uncommitted changes on transactional graphs. When "force" closed, the session won't bother to try to submit transaction close commands. It will be up to the underlying graph implementation to determine how it will clean up orphaned transactions. The force will try to cancel scheduled jobs and interrupt any currently running ones. Interruption is not guaranteed, but an attempt will be made.
-
-