Class HttpRequestMessage

  • All Implemented Interfaces:
    OutboundMessageType, io.netty.buffer.ByteBufHolder, io.netty.handler.codec.DecoderResultProvider, io.netty.handler.codec.http.FullHttpMessage, io.netty.handler.codec.http.FullHttpRequest, io.netty.handler.codec.http.HttpContent, io.netty.handler.codec.http.HttpMessage, io.netty.handler.codec.http.HttpObject, io.netty.handler.codec.http.HttpRequest, io.netty.handler.codec.http.LastHttpContent, io.netty.util.ReferenceCounted

    public class HttpRequestMessage
    extends io.netty.handler.codec.http.DefaultFullHttpRequest
    implements OutboundMessageType
    OutboundMessageType subtype that acts identically to DefaultFullHttpRequest.

    As it is an OutboundMessageType subtype, there is a modifyMessage method that modifies the request to reflect the new host and optional path. We also implement a name method, which returns a standard name and the current hostname.

    • Field Summary

      • Fields inherited from interface io.netty.handler.codec.http.LastHttpContent

    • Method Summary

      All Methods Instance Methods Concrete Methods 
      Modifier and Type Method Description
      HttpRequestMessage modifyMessage​(java.lang.String... args)
      Modifies headers to reflect new host and new path if applicable.
      java.lang.String name()
      Necessary to inform metrics collector what kind of message is sent down ChannelPipeline.
      java.lang.String responseName()
      Necessary to inform metrics collector what kind of message is sent inbound ChannelPipeline.
      HttpRequestMessage setUri​(java.lang.String path)  
      • Methods inherited from class io.netty.handler.codec.http.DefaultFullHttpRequest

        content, copy, duplicate, equals, hashCode, refCnt, release, release, replace, retain, retain, retainedDuplicate, setMethod, setProtocolVersion, toString, touch, touch, trailingHeaders
      • Methods inherited from class io.netty.handler.codec.http.DefaultHttpRequest

        getMethod, getUri, method, uri
      • Methods inherited from class io.netty.handler.codec.http.DefaultHttpMessage

        getProtocolVersion, headers, protocolVersion
      • Methods inherited from class io.netty.handler.codec.http.DefaultHttpObject

        decoderResult, getDecoderResult, setDecoderResult
      • Methods inherited from class java.lang.Object

        clone, finalize, getClass, notify, notifyAll, wait, wait, wait
      • Methods inherited from interface io.netty.handler.codec.DecoderResultProvider

        decoderResult, setDecoderResult
      • Methods inherited from interface io.netty.handler.codec.http.HttpMessage

        getProtocolVersion, headers, protocolVersion
      • Methods inherited from interface io.netty.handler.codec.http.HttpObject

      • Methods inherited from interface io.netty.handler.codec.http.HttpRequest

        getMethod, getUri, method, uri
    • Constructor Detail

      • HttpRequestMessage

        public HttpRequestMessage()
      • HttpRequestMessage

        public HttpRequestMessage​(io.netty.handler.codec.http.FullHttpRequest request)
        Used for conversion from FullHttpRequest to HttpRequestMessage
    • Method Detail

      • setUri

        public HttpRequestMessage setUri​(java.lang.String path)
        Specified by:
        setUri in interface io.netty.handler.codec.http.FullHttpRequest
        Specified by:
        setUri in interface io.netty.handler.codec.http.HttpRequest
        setUri in class io.netty.handler.codec.http.DefaultFullHttpRequest
      • modifyMessage

        public HttpRequestMessage modifyMessage​(java.lang.String... args)
                                         throws java.lang.IllegalArgumentException
        Modifies headers to reflect new host and new path if applicable.
        Specified by:
        modifyMessage in interface OutboundMessageType
      • name

        public java.lang.String name()
        Description copied from interface: OutboundMessageType
        Necessary to inform metrics collector what kind of message is sent down ChannelPipeline. Not equivalent to toString, as to different instances will have the same name if they perform the same action.
        Specified by:
        name in interface OutboundMessageType