Interface InboundChannelHandlerFactory
@Experimental
public interface InboundChannelHandlerFactory
Custom netty inbound handler factory in order to make custom changes on netty inbound data. Good
example usage of this API is custom authentication. When the user is not authenticated then the
instantiated channel handler can send back 401 to trigger negotiation. Since implementations are
loaded with service loader it's discouraged to store any internal state in factories.
-
Method Summary
Modifier and TypeMethodDescriptionOptional<org.apache.flink.shaded.netty4.io.netty.channel.ChannelHandler>createHandler(org.apache.flink.configuration.Configuration configuration, Map<String, String> responseHeaders) Creates new instance ofChannelHandlerintpriority()Gives back priority of theChannelHandler.
-
Method Details
-
priority
int priority()Gives back priority of theChannelHandler. The bigger the value is, the earlier it is executed. If multiple handlers have the same priority then the order is not defined.- Returns:
- the priority of the
ChannelHandler.
-
createHandler
Optional<org.apache.flink.shaded.netty4.io.netty.channel.ChannelHandler> createHandler(org.apache.flink.configuration.Configuration configuration, Map<String, String> responseHeaders) throws org.apache.flink.util.ConfigurationExceptionCreates new instance ofChannelHandler- Parameters:
configuration- The FlinkConfiguration.responseHeaders- The response headers.- Returns:
ChannelHandleror null if no custom handler need to be created.- Throws:
org.apache.flink.util.ConfigurationException- Thrown, if the handler configuration is incorrect.
-