Class VeniceRouteHandler<T extends ControllerResponse>
- java.lang.Object
-
- com.linkedin.venice.controller.server.VeniceRouteHandler<T>
-
- Type Parameters:
T
-
- All Implemented Interfaces:
spark.Route
public abstract class VeniceRouteHandler<T extends ControllerResponse> extends java.lang.Object implements spark.Route
Common route handler implement the common part of error handling and writing response to json.
-
-
Field Summary
Fields Modifier and Type Field Description static java.lang.String
ACL_CHECK_FAILURE_WARN_MESSAGE_PREFIX
-
Constructor Summary
Constructors Constructor Description VeniceRouteHandler(java.lang.Class<T> responseType)
-
Method Summary
All Methods Instance Methods Abstract Methods Concrete Methods Modifier and Type Method Description protected boolean
checkIsAllowListUser(spark.Request request, ControllerResponse veniceResponse, java.util.function.BooleanSupplier isAllowListUser)
java.lang.Object
handle(spark.Request request, spark.Response response)
abstract void
internalHandle(spark.Request request, T veniceResponse)
provides a common way to write a handler function for an HTTP request and fill in the HTTP response.
-
-
-
Field Detail
-
ACL_CHECK_FAILURE_WARN_MESSAGE_PREFIX
public static final java.lang.String ACL_CHECK_FAILURE_WARN_MESSAGE_PREFIX
- See Also:
- Constant Field Values
-
-
Constructor Detail
-
VeniceRouteHandler
public VeniceRouteHandler(java.lang.Class<T> responseType)
-
-
Method Detail
-
handle
public java.lang.Object handle(spark.Request request, spark.Response response) throws java.lang.Exception
- Specified by:
handle
in interfacespark.Route
- Throws:
java.lang.Exception
-
checkIsAllowListUser
protected boolean checkIsAllowListUser(spark.Request request, ControllerResponse veniceResponse, java.util.function.BooleanSupplier isAllowListUser)
-
internalHandle
public abstract void internalHandle(spark.Request request, T veniceResponse)
provides a common way to write a handler function for an HTTP request and fill in the HTTP response.- Parameters:
request
- HTTP request for Venice.veniceResponse
- Venice constructed response.
-
-