Class VeniceRouteHandler<T extends ControllerResponse>

  • 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.
    • 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.
      • Methods inherited from class java.lang.Object

        clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
    • 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 interface spark.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.