Class UnifiedHandler
- java.lang.Object
- 
- io.netty.channel.ChannelHandlerAdapter
- 
- io.netty.channel.ChannelInboundHandlerAdapter
- 
- io.netty.channel.SimpleChannelInboundHandler<RequestMessage>
- 
- org.apache.tinkerpop.gremlin.server.handler.UnifiedHandler
 
 
 
 
- 
- All Implemented Interfaces:
- io.netty.channel.ChannelHandler,- io.netty.channel.ChannelInboundHandler
 
 @Sharable public class UnifiedHandler extends io.netty.channel.SimpleChannelInboundHandler<RequestMessage> Handler for websockets to be used with theUnifiedChannelizer.
- 
- 
Field SummaryFields Modifier and Type Field Description protected Channelizerchannelizerprotected GraphManagergraphManagerprotected GremlinExecutorgremlinExecutorprotected static Set<String>INVALID_BINDINGS_KEYSThis may or may not be the full set of invalid binding keys.protected ScheduledExecutorServicescheduledExecutorServiceprotected ExecutorServicesessionExecutorprotected ConcurrentMap<String,Session>sessionsprotected Settingssettings
 - 
Constructor SummaryConstructors Constructor Description UnifiedHandler(Settings settings, GraphManager graphManager, GremlinExecutor gremlinExecutor, ScheduledExecutorService scheduledExecutorService, Channelizer channelizer)
 - 
Method SummaryAll Methods Instance Methods Concrete Methods Modifier and Type Method Description protected voidchannelRead0(io.netty.channel.ChannelHandlerContext ctx, RequestMessage msg)protected SessioncreateMultiTaskSession(SessionTask sessionTask, String sessionId)Called when creating aSessionthat will be long-lived to extend over multiple requests and therefore process the providedSessionTaskas well as ones that may arrive in the future.protected SessioncreateSingleTaskSession(SessionTask sessionTask, String sessionId)Called when creating a single task session where the providedSessionTaskwill be the only one to be executed and can therefore take a more efficient execution path.intgetActiveSessionCount()booleanisActiveSession(String sessionId)voiduserEventTriggered(io.netty.channel.ChannelHandlerContext ctx, Object evt)protected voidvalidateRequest(RequestMessage message, GraphManager graphManager)- 
Methods inherited from class io.netty.channel.SimpleChannelInboundHandleracceptInboundMessage, channelRead
 - 
Methods inherited from class io.netty.channel.ChannelInboundHandlerAdapterchannelActive, channelInactive, channelReadComplete, channelRegistered, channelUnregistered, channelWritabilityChanged, exceptionCaught
 - 
Methods inherited from class io.netty.channel.ChannelHandlerAdapterensureNotSharable, handlerAdded, handlerRemoved, isSharable
 
- 
 
- 
- 
- 
Field Detail- 
settingsprotected final Settings settings 
 - 
graphManagerprotected final GraphManager graphManager 
 - 
gremlinExecutorprotected final GremlinExecutor gremlinExecutor 
 - 
scheduledExecutorServiceprotected final ScheduledExecutorService scheduledExecutorService 
 - 
sessionExecutorprotected final ExecutorService sessionExecutor 
 - 
channelizerprotected final Channelizer channelizer 
 - 
sessionsprotected final ConcurrentMap<String,Session> sessions 
 - 
INVALID_BINDINGS_KEYSprotected static final Set<String> INVALID_BINDINGS_KEYS This may or may not be the full set of invalid binding keys. It is dependent on the static imports made to Gremlin Server. This should get rid of the worst offenders though and provide a good message back to the calling client. Use oftoUpperCase()on the accessor values ofTsolves an issue where theScriptEngineignores private scope onTand imports static fields.
 
- 
 - 
Constructor Detail- 
UnifiedHandlerpublic UnifiedHandler(Settings settings, GraphManager graphManager, GremlinExecutor gremlinExecutor, ScheduledExecutorService scheduledExecutorService, Channelizer channelizer) 
 
- 
 - 
Method Detail- 
channelRead0protected void channelRead0(io.netty.channel.ChannelHandlerContext ctx, RequestMessage msg) throws Exception- Specified by:
- channelRead0in class- io.netty.channel.SimpleChannelInboundHandler<RequestMessage>
- Throws:
- Exception
 
 - 
validateRequestprotected void validateRequest(RequestMessage message, GraphManager graphManager) throws SessionException - Throws:
- SessionException
 
 - 
userEventTriggeredpublic void userEventTriggered(io.netty.channel.ChannelHandlerContext ctx, Object evt) throws Exception- Specified by:
- userEventTriggeredin interface- io.netty.channel.ChannelInboundHandler
- Overrides:
- userEventTriggeredin class- io.netty.channel.ChannelInboundHandlerAdapter
- Throws:
- Exception
 
 - 
createSingleTaskSessionprotected Session createSingleTaskSession(SessionTask sessionTask, String sessionId) Called when creating a single task session where the providedSessionTaskwill be the only one to be executed and can therefore take a more efficient execution path.
 - 
createMultiTaskSessionprotected Session createMultiTaskSession(SessionTask sessionTask, String sessionId) Called when creating aSessionthat will be long-lived to extend over multiple requests and therefore process the providedSessionTaskas well as ones that may arrive in the future.
 - 
isActiveSessionpublic boolean isActiveSession(String sessionId) 
 - 
getActiveSessionCountpublic int getActiveSessionCount() 
 
- 
 
-