Class 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 the UnifiedChannelizer.
    • Field Detail

      • settings

        protected final Settings settings
      • INVALID_BINDINGS_KEYS

        protected 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 of toUpperCase() on the accessor values of T solves an issue where the ScriptEngine ignores private scope on T and imports static fields.

    • Method Detail

      • channelRead0

        protected void channelRead0​(io.netty.channel.ChannelHandlerContext ctx,
                                    RequestMessage msg)
                             throws Exception
        Specified by:
        channelRead0 in class io.netty.channel.SimpleChannelInboundHandler<RequestMessage>
        Throws:
        Exception
      • userEventTriggered

        public void userEventTriggered​(io.netty.channel.ChannelHandlerContext ctx,
                                       Object evt)
                                throws Exception
        Specified by:
        userEventTriggered in interface io.netty.channel.ChannelInboundHandler
        Overrides:
        userEventTriggered in class io.netty.channel.ChannelInboundHandlerAdapter
        Throws:
        Exception
      • createSingleTaskSession

        protected Session createSingleTaskSession​(SessionTask sessionTask,
                                                  String sessionId)
        Called when creating a single task session where the provided SessionTask will be the only one to be executed and can therefore take a more efficient execution path.
      • createMultiTaskSession

        protected Session createMultiTaskSession​(SessionTask sessionTask,
                                                 String sessionId)
        Called when creating a Session that will be long-lived to extend over multiple requests and therefore process the provided SessionTask as well as ones that may arrive in the future.
      • isActiveSession

        public boolean isActiveSession​(String sessionId)
      • getActiveSessionCount

        public int getActiveSessionCount()