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
    Constructor
    Description
     
  • Method Summary

    Modifier and Type
    Method
    Description
    abstract HttpByteBuf
    intercept(io.netty.channel.ChannelHandlerContext ctx, HttpRequest request)
     
    final boolean
    isRelevant(net.mcbrawls.inject.api.InjectorContext ctx, net.mcbrawls.inject.api.PacketDirection direction)
     
    boolean
    isRelevant(net.mcbrawls.inject.api.InjectorContext ctx, HttpRequest request)
    Predicate for matching if this injector is relevant to the given HTTP request.
    boolean
    onRead(io.netty.channel.ChannelHandlerContext ctx, io.netty.buffer.ByteBuf buf)
     

    Methods inherited from class net.mcbrawls.inject.api.Injector

    channelRead, onWrite, write

    Methods inherited from class io.netty.channel.ChannelDuplexHandler

    bind, close, connect, deregister, disconnect, flush, read

    Methods inherited from class io.netty.channel.ChannelInboundHandlerAdapter

    channelActive, channelInactive, channelReadComplete, channelRegistered, channelUnregistered, channelWritabilityChanged, exceptionCaught, userEventTriggered

    Methods inherited from class io.netty.channel.ChannelHandlerAdapter

    ensureNotSharable, handlerAdded, handlerRemoved, isSharable

    Methods inherited from class java.lang.Object

    clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait

    Methods 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

      public boolean isRelevant(net.mcbrawls.inject.api.InjectorContext ctx, HttpRequest request)
      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:
      isRelevant in class net.mcbrawls.inject.api.Injector
    • onRead

      public boolean onRead(io.netty.channel.ChannelHandlerContext ctx, io.netty.buffer.ByteBuf buf) throws Exception
      Overrides:
      onRead in class net.mcbrawls.inject.api.Injector
      Throws:
      Exception