Class HttpHandler

java.lang.Object
com.yahoo.jdisc.AbstractResource
com.yahoo.jdisc.handler.AbstractRequestHandler
com.yahoo.container.jdisc.ThreadedRequestHandler
com.yahoo.container.jdisc.ThreadedHttpRequestHandler
com.yahoo.vespa.config.server.http.HttpHandler
All Implemented Interfaces:
com.yahoo.container.jdisc.HttpRequestHandler, com.yahoo.jdisc.handler.RequestHandler, com.yahoo.jdisc.SharedResource
Direct Known Subclasses:
ApplicationHandler, HostHandler, HttpGetConfigHandler, HttpGetConfigHandler, HttpListConfigsHandler, HttpListConfigsHandler, HttpListNamedConfigsHandler, HttpListNamedConfigsHandler, ListApplicationsHandler, SessionHandler, StatusHandler

public class HttpHandler extends com.yahoo.container.jdisc.ThreadedHttpRequestHandler
Super class for http handlers, that takes care of checking valid methods for a request. Handlers should subclass this method and implement the handleMETHOD methods that it supports.
Author:
hmusum
  • Nested Class Summary

    Nested classes/interfaces inherited from class com.yahoo.container.jdisc.ThreadedHttpRequestHandler

    com.yahoo.container.jdisc.ThreadedHttpRequestHandler.Context, com.yahoo.container.jdisc.ThreadedHttpRequestHandler.LazyContentChannel

    Nested classes/interfaces inherited from interface com.yahoo.jdisc.SharedResource

    com.yahoo.jdisc.SharedResource.Debug
  • Field Summary

    Fields inherited from class com.yahoo.container.jdisc.ThreadedHttpRequestHandler

    CONTENT_TYPE, log

    Fields inherited from class com.yahoo.container.jdisc.ThreadedRequestHandler

    metric

    Fields inherited from interface com.yahoo.jdisc.SharedResource

    DEBUG, SYSTEM_PROPERTY_NAME_DEBUG
  • Constructor Summary

    Constructors
    Constructor
    Description
    HttpHandler(com.yahoo.container.jdisc.ThreadedHttpRequestHandler.Context ctx)
     
  • Method Summary

    Modifier and Type
    Method
    Description
    protected static Duration
    getRequestTimeout(com.yahoo.container.jdisc.HttpRequest request, Duration defaultTimeout)
     
    com.yahoo.container.jdisc.HttpResponse
    handle(com.yahoo.container.jdisc.HttpRequest request)
     
    protected com.yahoo.container.jdisc.HttpResponse
    handleDELETE(com.yahoo.container.jdisc.HttpRequest request)
    Default implementation of handler for DELETE requests.
    protected com.yahoo.container.jdisc.HttpResponse
    handleGET(com.yahoo.container.jdisc.HttpRequest request)
    Default implementation of handler for GET requests.
    protected com.yahoo.container.jdisc.HttpResponse
    handlePOST(com.yahoo.container.jdisc.HttpRequest request)
    Default implementation of handler for POST requests.
    protected com.yahoo.container.jdisc.HttpResponse
    handlePUT(com.yahoo.container.jdisc.HttpRequest request)
    Default implementation of handler for PUT requests.

    Methods inherited from class com.yahoo.container.jdisc.ThreadedHttpRequestHandler

    addDateHeader, asHttpRequest, createLoggingCompletionHandler, handle, handleRequest, testContext

    Methods inherited from class com.yahoo.container.jdisc.ThreadedRequestHandler

    executor, getRequestType, getTimeout, handleRequest, writeErrorResponseOnOverload

    Methods inherited from class com.yahoo.jdisc.handler.AbstractRequestHandler

    handleTimeout

    Methods inherited from class com.yahoo.jdisc.AbstractResource

    currentState, destroy, refer, refer, release, retainCount

    Methods inherited from class java.lang.Object

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

    Methods inherited from interface com.yahoo.container.jdisc.HttpRequestHandler

    requestHandlerSpec

    Methods inherited from interface com.yahoo.jdisc.handler.RequestHandler

    handleRequest, handleTimeout

    Methods inherited from interface com.yahoo.jdisc.SharedResource

    refer, refer, release
  • Constructor Details

    • HttpHandler

      public HttpHandler(com.yahoo.container.jdisc.ThreadedHttpRequestHandler.Context ctx)
  • Method Details

    • handle

      public com.yahoo.container.jdisc.HttpResponse handle(com.yahoo.container.jdisc.HttpRequest request)
      Specified by:
      handle in class com.yahoo.container.jdisc.ThreadedHttpRequestHandler
    • getRequestTimeout

      protected static Duration getRequestTimeout(com.yahoo.container.jdisc.HttpRequest request, Duration defaultTimeout)
    • handleGET

      protected com.yahoo.container.jdisc.HttpResponse handleGET(com.yahoo.container.jdisc.HttpRequest request)
      Default implementation of handler for GET requests. Returns an error response. Override this method to handle GET requests.
      Parameters:
      request - a HttpRequest
      Returns:
      an error response with response code 405
    • handlePOST

      protected com.yahoo.container.jdisc.HttpResponse handlePOST(com.yahoo.container.jdisc.HttpRequest request)
      Default implementation of handler for POST requests. Returns an error response. Override this method to handle POST requests.
      Parameters:
      request - a HttpRequest
      Returns:
      an error response with response code 405
    • handlePUT

      protected com.yahoo.container.jdisc.HttpResponse handlePUT(com.yahoo.container.jdisc.HttpRequest request)
      Default implementation of handler for PUT requests. Returns an error response. Override this method to handle POST requests.
      Parameters:
      request - a HttpRequest
      Returns:
      an error response with response code 405
    • handleDELETE

      protected com.yahoo.container.jdisc.HttpResponse handleDELETE(com.yahoo.container.jdisc.HttpRequest request)
      Default implementation of handler for DELETE requests. Returns an error response. Override this method to handle DELETE requests.
      Parameters:
      request - a HttpRequest
      Returns:
      an error response with response code 405