Class DefaultHttpResult

  • All Implemented Interfaces:
    HttpResult

    public class DefaultHttpResult
    extends java.lang.Object
    implements HttpResult
    Default implementation of HttpResult.
    Since:
    1.1
    • Constructor Summary

      Constructors 
      Constructor Description
      DefaultHttpResult​(HttpRequestContext requestContext, long resultLength, io.netty.handler.codec.http.HttpResponseStatus responseStatus)
      Creates a new DefaultHttpResult instance with the specified params given.
      DefaultHttpResult​(HttpRequestContext requestContext, long resultLength, io.netty.handler.codec.http.HttpResponseStatus responseStatus, long respondedNaonTime, java.time.ZonedDateTime respondedTime)
      Creates a new DefaultHttpResult instance with the specified params given.
    • Method Summary

      All Methods Instance Methods Concrete Methods 
      Modifier and Type Method Description
      HttpRequestContext requestContext()
      Returns the context of the HTTP request.
      long respondedNaonTime()
      Returns the value of the running Java Virtual Machine'shigh-resolution time source, in nanoseconds, when the HTTP response just responded.
      java.time.ZonedDateTime respondedTime()
      Returns the ZonedDateTime with the system ZoneId when the HTTP response just responded.
      io.netty.handler.codec.http.HttpResponseStatus responseStatus()
      Returns the status of the HTTP response.
      long resultLength()
      Returns the length of the HTTP response content.
      java.lang.String toString()  
      • Methods inherited from class java.lang.Object

        clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
    • Constructor Detail

      • DefaultHttpResult

        public DefaultHttpResult​(HttpRequestContext requestContext,
                                 long resultLength,
                                 io.netty.handler.codec.http.HttpResponseStatus responseStatus)
        Creates a new DefaultHttpResult instance with the specified params given.
        Parameters:
        requestContext - an HttpRequestContext
        resultLength - the length of the HTTP response body content
        responseStatus - the HttpResponseStatus of the HTTP response
      • DefaultHttpResult

        public DefaultHttpResult​(HttpRequestContext requestContext,
                                 long resultLength,
                                 io.netty.handler.codec.http.HttpResponseStatus responseStatus,
                                 long respondedNaonTime,
                                 java.time.ZonedDateTime respondedTime)
        Creates a new DefaultHttpResult instance with the specified params given.
        Parameters:
        requestContext - an HttpRequestContext
        resultLength - the length of the HTTP response body content
        responseStatus - the HttpResponseStatus of the HTTP response
        respondedNaonTime - the value of the running Java Virtual Machine'shigh-resolution time source, in nanoseconds, when the HTTP response just responded
        respondedTime - the ZonedDateTime when the HTTP response just responded
    • Method Detail

      • resultLength

        public long resultLength()
        Description copied from interface: HttpResult
        Returns the length of the HTTP response content.
        Specified by:
        resultLength in interface HttpResult
        Returns:
        the length of the HTTP response content
      • responseStatus

        public io.netty.handler.codec.http.HttpResponseStatus responseStatus()
        Description copied from interface: HttpResult
        Returns the status of the HTTP response.
        Specified by:
        responseStatus in interface HttpResult
        Returns:
        the status of the HTTP response
      • respondedNaonTime

        public long respondedNaonTime()
        Description copied from interface: HttpResult
        Returns the value of the running Java Virtual Machine'shigh-resolution time source, in nanoseconds, when the HTTP response just responded.
        Specified by:
        respondedNaonTime in interface HttpResult
        Returns:
        the value of the running Java Virtual Machine'shigh-resolution time source, in nanoseconds
        See Also:
        System.nanoTime()
      • respondedTime

        public java.time.ZonedDateTime respondedTime()
        Description copied from interface: HttpResult
        Returns the ZonedDateTime with the system ZoneId when the HTTP response just responded.
        Specified by:
        respondedTime in interface HttpResult
        Returns:
        a ZonedDateTime
      • toString

        public java.lang.String toString()
        Overrides:
        toString in class java.lang.Object