Class HttpSearchResponse


  • public class HttpSearchResponse
    extends com.yahoo.container.jdisc.ExtendedResponse
    Wrap the result of a query as an HTTP response.
    Author:
    Steinar Knutsen
    • Field Summary

      • Fields inherited from class com.yahoo.container.jdisc.HttpResponse

        DEFAULT_CHARACTER_ENCODING, DEFAULT_MIME_TYPE
    • Constructor Summary

      Constructors 
      Constructor Description
      HttpSearchResponse​(int status, Result result, Query query, com.yahoo.processing.rendering.Renderer<Result> renderer)  
    • Method Summary

      All Methods Static Methods Instance Methods Concrete Methods 
      Modifier and Type Method Description
      java.lang.String getCharacterEncoding()
      Returns expected character encoding of this response
      java.lang.String getContentType()
      Returns MIME type of this response
      com.yahoo.container.handler.Coverage getCoverage()  
      com.yahoo.container.logging.HitCounts getHitCounts()  
      java.lang.Iterable<com.yahoo.processing.execution.Execution.Trace.LogValue> getLogValues()  
      java.lang.String getParsedQuery()  
      Query getQuery()
      Returns the query wrapped by this
      Result getResult()
      Returns the result wrapped by this
      com.yahoo.container.handler.Timing getTiming()  
      void populateAccessLogEntry​(com.yahoo.container.logging.AccessLogEntry accessLogEntry)  
      void render​(java.io.OutputStream output, com.yahoo.jdisc.handler.ContentChannel networkChannel, com.yahoo.jdisc.handler.CompletionHandler handler)  
      static com.google.common.util.concurrent.ListenableFuture<java.lang.Boolean> waitableRender​(Result result, Query query, com.yahoo.processing.rendering.Renderer<Result> renderer, java.io.OutputStream stream)  
      com.google.common.util.concurrent.ListenableFuture<java.lang.Boolean> waitableRender​(java.io.OutputStream stream)  
      • Methods inherited from class com.yahoo.container.jdisc.ExtendedResponse

        getUser
      • Methods inherited from class com.yahoo.container.jdisc.AsyncHttpResponse

        render
      • Methods inherited from class com.yahoo.container.jdisc.HttpResponse

        complete, getJdiscResponse, getRequestType, getStatus, headers, maxPendingBytes, setRequestType, setStatus
      • Methods inherited from class java.lang.Object

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

      • HttpSearchResponse

        public HttpSearchResponse​(int status,
                                  Result result,
                                  Query query,
                                  com.yahoo.processing.rendering.Renderer<Result> renderer)
    • Method Detail

      • waitableRender

        public com.google.common.util.concurrent.ListenableFuture<java.lang.Boolean> waitableRender​(java.io.OutputStream stream)
                                                                                             throws java.io.IOException
        Throws:
        java.io.IOException
      • waitableRender

        public static com.google.common.util.concurrent.ListenableFuture<java.lang.Boolean> waitableRender​(Result result,
                                                                                                           Query query,
                                                                                                           com.yahoo.processing.rendering.Renderer<Result> renderer,
                                                                                                           java.io.OutputStream stream)
                                                                                                    throws java.io.IOException
        Throws:
        java.io.IOException
      • render

        public void render​(java.io.OutputStream output,
                           com.yahoo.jdisc.handler.ContentChannel networkChannel,
                           com.yahoo.jdisc.handler.CompletionHandler handler)
                    throws java.io.IOException
        Specified by:
        render in class com.yahoo.container.jdisc.ExtendedResponse
        Throws:
        java.io.IOException
      • populateAccessLogEntry

        public void populateAccessLogEntry​(com.yahoo.container.logging.AccessLogEntry accessLogEntry)
        Overrides:
        populateAccessLogEntry in class com.yahoo.container.jdisc.HttpResponse
      • getParsedQuery

        public java.lang.String getParsedQuery()
        Overrides:
        getParsedQuery in class com.yahoo.container.jdisc.ExtendedResponse
      • getTiming

        public com.yahoo.container.handler.Timing getTiming()
        Overrides:
        getTiming in class com.yahoo.container.jdisc.ExtendedResponse
      • getCoverage

        public com.yahoo.container.handler.Coverage getCoverage()
        Overrides:
        getCoverage in class com.yahoo.container.jdisc.ExtendedResponse
      • getHitCounts

        public com.yahoo.container.logging.HitCounts getHitCounts()
        Overrides:
        getHitCounts in class com.yahoo.container.jdisc.ExtendedResponse
      • getContentType

        public java.lang.String getContentType()
        Returns MIME type of this response
        Overrides:
        getContentType in class com.yahoo.container.jdisc.HttpResponse
      • getCharacterEncoding

        public java.lang.String getCharacterEncoding()
        Returns expected character encoding of this response
        Overrides:
        getCharacterEncoding in class com.yahoo.container.jdisc.HttpResponse
      • getQuery

        public Query getQuery()
        Returns the query wrapped by this
      • getResult

        public Result getResult()
        Returns the result wrapped by this
      • getLogValues

        public java.lang.Iterable<com.yahoo.processing.execution.Execution.Trace.LogValue> getLogValues()
        Overrides:
        getLogValues in class com.yahoo.container.jdisc.HttpResponse