Class AbstractChannelizer
- java.lang.Object
-
- io.netty.channel.ChannelHandlerAdapter
-
- io.netty.channel.ChannelInboundHandlerAdapter
-
- io.netty.channel.ChannelInitializer<io.netty.channel.socket.SocketChannel>
-
- org.apache.tinkerpop.gremlin.server.AbstractChannelizer
-
- All Implemented Interfaces:
io.netty.channel.ChannelHandler,io.netty.channel.ChannelInboundHandler,Channelizer
- Direct Known Subclasses:
HttpChannelizer
public abstract class AbstractChannelizer extends io.netty.channel.ChannelInitializer<io.netty.channel.socket.SocketChannel> implements Channelizer
A base implementation for theChannelizerwhich does a basic configuration of the pipeline, one that is generally common to virtually any Gremlin Server operation (i.e. where the server's purpose is to process Gremlin scripts). Implementers need only worry about determining how incoming data is converted to aRequestMessageand outgoing data is converted from aResponseMessageto whatever expected format is needed by the pipeline.- Author:
- Stephen Mallette (http://stephen.genoprime.com)
-
-
Field Summary
Fields Modifier and Type Field Description protected Authenticatorauthenticatorprotected Authorizerauthorizerprotected io.netty.channel.group.ChannelGroupchannelsprotected static List<Settings.SerializerSettings>DEFAULT_SERIALIZERSprotected GraphManagergraphManagerprotected static StringGREMLIN_ENDPOINTprotected GremlinExecutorgremlinExecutorprotected ExecutorServicegremlinExecutorServicestatic StringPIPELINE_AUTHENTICATORstatic StringPIPELINE_AUTHORIZERstatic StringPIPELINE_HTTP_AGGREGATORprotected static StringPIPELINE_HTTP_REQUEST_DECODERstatic StringPIPELINE_HTTP_RESPONSE_ENCODERstatic StringPIPELINE_HTTP_USER_AGENT_HANDLERstatic StringPIPELINE_REQUEST_HANDLERprotected static StringPIPELINE_SSLprotected ScheduledExecutorServicescheduledExecutorServiceprotected Map<String,MessageSerializer<?>>serializersprotected Settingssettingsprotected Optional<io.netty.handler.ssl.SslContext>sslContext
-
Constructor Summary
Constructors Constructor Description AbstractChannelizer()
-
Method Summary
All Methods Instance Methods Abstract Methods Concrete Methods Modifier and Type Method Description abstract voidconfigure(io.netty.channel.ChannelPipeline pipeline)This method is called from withininitChannel(SocketChannel)just after the SSL handler is put in the pipeline.protected AbstractAuthenticationHandlercreateAuthenticationHandler(Settings settings)voidinit(ServerGremlinExecutor serverGremlinExecutor)This method is called just after theChannelizeris initialized.voidinitChannel(io.netty.channel.socket.SocketChannel ch)It is best not to override this method as it sets up some core parts to the server.-
Methods inherited from class io.netty.channel.ChannelInitializer
channelRegistered, exceptionCaught, handlerAdded, handlerRemoved
-
Methods inherited from class io.netty.channel.ChannelInboundHandlerAdapter
channelActive, channelInactive, channelRead, channelReadComplete, channelUnregistered, channelWritabilityChanged, userEventTriggered
-
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
-
Methods inherited from interface org.apache.tinkerpop.gremlin.server.Channelizer
createIdleDetectionMessage, supportsIdleMonitor
-
-
-
-
Field Detail
-
DEFAULT_SERIALIZERS
protected static final List<Settings.SerializerSettings> DEFAULT_SERIALIZERS
-
settings
protected Settings settings
-
gremlinExecutor
protected GremlinExecutor gremlinExecutor
-
sslContext
protected Optional<io.netty.handler.ssl.SslContext> sslContext
-
graphManager
protected GraphManager graphManager
-
gremlinExecutorService
protected ExecutorService gremlinExecutorService
-
scheduledExecutorService
protected ScheduledExecutorService scheduledExecutorService
-
PIPELINE_AUTHENTICATOR
public static final String PIPELINE_AUTHENTICATOR
- See Also:
- Constant Field Values
-
PIPELINE_AUTHORIZER
public static final String PIPELINE_AUTHORIZER
- See Also:
- Constant Field Values
-
PIPELINE_REQUEST_HANDLER
public static final String PIPELINE_REQUEST_HANDLER
- See Also:
- Constant Field Values
-
PIPELINE_HTTP_RESPONSE_ENCODER
public static final String PIPELINE_HTTP_RESPONSE_ENCODER
- See Also:
- Constant Field Values
-
PIPELINE_HTTP_AGGREGATOR
public static final String PIPELINE_HTTP_AGGREGATOR
- See Also:
- Constant Field Values
-
PIPELINE_HTTP_USER_AGENT_HANDLER
public static final String PIPELINE_HTTP_USER_AGENT_HANDLER
- See Also:
- Constant Field Values
-
PIPELINE_SSL
protected static final String PIPELINE_SSL
- See Also:
- Constant Field Values
-
PIPELINE_HTTP_REQUEST_DECODER
protected static final String PIPELINE_HTTP_REQUEST_DECODER
- See Also:
- Constant Field Values
-
GREMLIN_ENDPOINT
protected static final String GREMLIN_ENDPOINT
- See Also:
- Constant Field Values
-
serializers
protected final Map<String,MessageSerializer<?>> serializers
-
channels
protected io.netty.channel.group.ChannelGroup channels
-
authenticator
protected Authenticator authenticator
-
authorizer
protected Authorizer authorizer
-
-
Method Detail
-
configure
public abstract void configure(io.netty.channel.ChannelPipeline pipeline)
This method is called from withininitChannel(SocketChannel)just after the SSL handler is put in the pipeline. Modify the pipeline as needed here.
-
init
public void init(ServerGremlinExecutor serverGremlinExecutor)
Description copied from interface:ChannelizerThis method is called just after theChannelizeris initialized.- Specified by:
initin interfaceChannelizer
-
initChannel
public void initChannel(io.netty.channel.socket.SocketChannel ch) throws ExceptionIt is best not to override this method as it sets up some core parts to the server. Prefer implementing theconfigure(ChannelPipeline)methods to alter the pipeline.- Specified by:
initChannelin classio.netty.channel.ChannelInitializer<io.netty.channel.socket.SocketChannel>- Throws:
Exception
-
createAuthenticationHandler
protected AbstractAuthenticationHandler createAuthenticationHandler(Settings settings)
-
-