public class SessionOpProcessor extends AbstractEvalOpProcessor
OpProcessor implementation that handles
 ScriptEngine script evaluation in the context of a session. Note that this processor will
 also take a "close" op to kill the session and rollback any incomplete transactions.AbstractEvalOpProcessor.BindingSupplier| Modifier and Type | Field and Description | 
|---|---|
static String | 
CONFIG_SESSION_TIMEOUT
Configuration setting for how long a session will be available before it timesout. 
 | 
static long | 
DEFAULT_SESSION_TIMEOUT
Default timeout for a session is eight hours. 
 | 
static String | 
OP_PROCESSOR_NAME  | 
protected static ConcurrentHashMap<String,Session> | 
sessions
Script engines are evaluated in a per session context where imports/scripts are isolated per session. 
 | 
evalOpTimer, validBindingNamemanageTransactions| Constructor and Description | 
|---|
SessionOpProcessor()  | 
| Modifier and Type | Method and Description | 
|---|---|
void | 
close()  | 
protected void | 
evalOp(Context context)  | 
protected Function<Context,AbstractEvalOpProcessor.BindingSupplier> | 
getBindingMaker(Session session)
A useful method for those extending this class, where the means for binding construction can be supplied
 to this class. 
 | 
ThrowingConsumer<Context> | 
getEvalOp()
Provides an operation for evaluating a Gremlin script. 
 | 
String | 
getName()
The name of the processor which requests must refer to "processor" field on a request. 
 | 
protected static Session | 
getSession(Context context,
          RequestMessage msg)
Examines the  
RequestMessage and extracts the session token. | 
Optional<ThrowingConsumer<Context>> | 
selectOther(RequestMessage requestMessage)
Session based requests accept a "close" operator in addition to "eval". 
 | 
protected Optional<ThrowingConsumer<Context>> | 
validateEvalMessage(RequestMessage message)  | 
evalOpInternal, selectattemptCommit, attemptRollback, handleIterator, makeFramepublic static final String OP_PROCESSOR_NAME
protected static ConcurrentHashMap<String,Session> sessions
public static final String CONFIG_SESSION_TIMEOUT
public static final long DEFAULT_SESSION_TIMEOUT
public String getName()
OpProcessorpublic Optional<ThrowingConsumer<Context>> selectOther(RequestMessage requestMessage) throws OpProcessorException
selectOther in class AbstractEvalOpProcessorOpProcessorExceptionpublic ThrowingConsumer<Context> getEvalOp()
AbstractEvalOpProcessorgetEvalOp in class AbstractEvalOpProcessorprotected Optional<ThrowingConsumer<Context>> validateEvalMessage(RequestMessage message) throws OpProcessorException
validateEvalMessage in class AbstractEvalOpProcessorOpProcessorExceptionprotected void evalOp(Context context) throws OpProcessorException
OpProcessorExceptionprotected static Session getSession(Context context, RequestMessage msg)
RequestMessage and extracts the session token. The session is then either found or a new
 one is created.protected Function<Context,AbstractEvalOpProcessor.BindingSupplier> getBindingMaker(Session session)
evalOp(Context) to create the final argument to
 AbstractEvalOpProcessor.evalOpInternal(Context, Supplier, org.apache.tinkerpop.gremlin.server.op.AbstractEvalOpProcessor.BindingSupplier).
 In this way an extending class can use the default AbstractEvalOpProcessor.BindingSupplier
 which carries a lot of re-usable functionality or provide a new one to override the existing approach.Copyright © 2013–2016 Apache Software Foundation. All rights reserved.