Package com.yahoo.restapi
Class RestApiRequestHandler<T extends RestApiRequestHandler<T>>
java.lang.Object
com.yahoo.jdisc.AbstractResource
com.yahoo.jdisc.handler.AbstractRequestHandler
com.yahoo.container.jdisc.ThreadedRequestHandler
com.yahoo.container.jdisc.ThreadedHttpRequestHandler
com.yahoo.restapi.RestApiRequestHandler<T>
- All Implemented Interfaces:
HttpRequestHandler
,com.yahoo.jdisc.handler.RequestHandler
,com.yahoo.jdisc.SharedResource
public abstract class RestApiRequestHandler<T extends RestApiRequestHandler<T>>
extends ThreadedHttpRequestHandler
- Author:
- bjorncs
-
Nested Class Summary
Nested classes/interfaces inherited from class com.yahoo.container.jdisc.ThreadedHttpRequestHandler
ThreadedHttpRequestHandler.Context, 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
ModifierConstructorDescriptionprotected
RestApiRequestHandler
(ThreadedHttpRequestHandler.Context context, RestApi restApi) protected
RestApiRequestHandler
(ThreadedHttpRequestHandler.Context context, RestApiRequestHandler.RestApiProvider<T> provider) RestApi will usually refer to handler methods of subclass, which are not accessible before super constructor has completed.protected
RestApiRequestHandler
(Executor executor, com.yahoo.jdisc.Metric metric, RestApi restApi) protected
RestApiRequestHandler
(Executor executor, com.yahoo.jdisc.Metric metric, RestApiRequestHandler.RestApiProvider<T> provider) -
Method Summary
Modifier and TypeMethodDescriptionfinal HttpResponse
handle
(HttpRequest request) Override this to implement a synchronous style handler.restApi()
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.jdisc.handler.RequestHandler
handleRequest, handleTimeout
Methods inherited from interface com.yahoo.jdisc.SharedResource
refer, refer, release
-
Constructor Details
-
RestApiRequestHandler
protected RestApiRequestHandler(ThreadedHttpRequestHandler.Context context, RestApiRequestHandler.RestApiProvider<T> provider) RestApi will usually refer to handler methods of subclass, which are not accessible before super constructor has completed. This is hack to leak reference to subclass instance's "this" reference. Caller must ensure that provider instance does not try to access any uninitialized fields. -
RestApiRequestHandler
protected RestApiRequestHandler(Executor executor, com.yahoo.jdisc.Metric metric, RestApiRequestHandler.RestApiProvider<T> provider) -
RestApiRequestHandler
-
RestApiRequestHandler
-
-
Method Details
-
handle
Description copied from class:ThreadedHttpRequestHandler
Override this to implement a synchronous style handler.- Specified by:
handle
in classThreadedHttpRequestHandler
- Parameters:
request
- incoming HTTP request- Returns:
- a valid HTTP response for presentation to the user
-
requestHandlerSpec
- Returns:
- handler specification
-
restApi
-