Package net.mcbrawls.inject.http
Class HttpInjector
java.lang.Object
io.netty.channel.ChannelHandlerAdapter
io.netty.channel.ChannelInboundHandlerAdapter
io.netty.channel.ChannelDuplexHandler
net.mcbrawls.inject.api.Injector
net.mcbrawls.inject.http.HttpInjector
- All Implemented Interfaces:
io.netty.channel.ChannelHandler,io.netty.channel.ChannelInboundHandler,io.netty.channel.ChannelOutboundHandler
@Sharable
public abstract class HttpInjector
extends net.mcbrawls.inject.api.Injector
-
Nested Class Summary
Nested classes/interfaces inherited from interface io.netty.channel.ChannelHandler
io.netty.channel.ChannelHandler.Sharable -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionabstract HttpByteBufintercept(io.netty.channel.ChannelHandlerContext ctx, HttpRequest request) final booleanisRelevant(net.mcbrawls.inject.api.InjectorContext ctx, net.mcbrawls.inject.api.PacketDirection direction) booleanisRelevant(net.mcbrawls.inject.api.InjectorContext ctx, HttpRequest request) Predicate for matching if this injector is relevant to the given HTTP request.booleanonRead(io.netty.channel.ChannelHandlerContext ctx, io.netty.buffer.ByteBuf buf) Methods inherited from class net.mcbrawls.inject.api.Injector
channelRead, onWrite, writeMethods inherited from class io.netty.channel.ChannelDuplexHandler
bind, close, connect, deregister, disconnect, flush, readMethods inherited from class io.netty.channel.ChannelInboundHandlerAdapter
channelActive, channelInactive, channelReadComplete, channelRegistered, channelUnregistered, channelWritabilityChanged, exceptionCaught, userEventTriggeredMethods inherited from class io.netty.channel.ChannelHandlerAdapter
ensureNotSharable, handlerAdded, handlerRemoved, isSharableMethods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, waitMethods inherited from interface io.netty.channel.ChannelHandler
handlerAdded, handlerRemoved
-
Constructor Details
-
HttpInjector
public HttpInjector()
-
-
Method Details
-
intercept
public abstract HttpByteBuf intercept(io.netty.channel.ChannelHandlerContext ctx, HttpRequest request) -
isRelevant
Predicate for matching if this injector is relevant to the given HTTP request. Should only need to be overridden once you are dealing with multiple HTTP injectors.- Parameters:
ctx- the context.request- the HTTP request.- Returns:
- true if it is relevant and should be handled by this injector, false if not.
-
isRelevant
public final boolean isRelevant(net.mcbrawls.inject.api.InjectorContext ctx, net.mcbrawls.inject.api.PacketDirection direction) - Overrides:
isRelevantin classnet.mcbrawls.inject.api.Injector
-
onRead
public boolean onRead(io.netty.channel.ChannelHandlerContext ctx, io.netty.buffer.ByteBuf buf) throws Exception - Overrides:
onReadin classnet.mcbrawls.inject.api.Injector- Throws:
Exception
-