Pivot
  1. Pivot
  2. PIVOT-402

Update QueryServlet API for consistency with client-side Query API

    Details

    • Type: Improvement Improvement
    • Status: Resolved
    • Priority: Major Major
    • Resolution: Fixed
    • Affects Version/s: None
    • Fix Version/s: 1.5
    • Component/s: web
    • Labels:

      Activity

      Hide
      Greg Brown added a comment - - edited

      API updates:

      • Replaced custom server exceptions with existing QueryException.
      • Added path argument to doGet(), doPost(), etc. that contains the part of the URL after the servlet path but before the query string (this is the part that is generally going to be most relevant to the servlet; the actual servlet path is still available via getServletPath()).
      • Eliminated dependency on basic authentication (this is now up to the implementing class and can be facilitated by setting appropriate response headers and throwing QueryException(401)).
      • Added a doPostAction() method - this allows a query servlet to perform additional "actions" in addition to the CRUD operations e.g. "log in" or "power on VM").
      • Added prepare() and dispose() methods that are called before doGet(), doPost(), etc. that can be used to initialize a DB connection or otherwise.
      • Moved determineContentLength to servlet initialization parameter (currently incomplete; property is hard-coded to false).
      • Determine serializer to use based on Content-Type header rather than hard-coding (allows servlets to dynamically select serializer based on request; eventually this mapping will also be configurable via servlet init params).

      Fixes:

      • Added support for case-insensitive handling of keys in QueryDictionary (HTTP headers are case-insensitive, but query string parameters are not).
      Show
      Greg Brown added a comment - - edited API updates: Replaced custom server exceptions with existing QueryException. Added path argument to doGet(), doPost(), etc. that contains the part of the URL after the servlet path but before the query string (this is the part that is generally going to be most relevant to the servlet; the actual servlet path is still available via getServletPath()). Eliminated dependency on basic authentication (this is now up to the implementing class and can be facilitated by setting appropriate response headers and throwing QueryException(401)). Added a doPostAction() method - this allows a query servlet to perform additional "actions" in addition to the CRUD operations e.g. "log in" or "power on VM"). Added prepare() and dispose() methods that are called before doGet(), doPost(), etc. that can be used to initialize a DB connection or otherwise. Moved determineContentLength to servlet initialization parameter (currently incomplete; property is hard-coded to false). Determine serializer to use based on Content-Type header rather than hard-coding (allows servlets to dynamically select serializer based on request; eventually this mapping will also be configurable via servlet init params). Fixes: Added support for case-insensitive handling of keys in QueryDictionary (HTTP headers are case-insensitive, but query string parameters are not).

        People

        • Assignee:
          Greg Brown
          Reporter:
          Greg Brown
        • Votes:
          0 Vote for this issue
          Watchers:
          0 Start watching this issue

          Dates

          • Created:
            Updated:
            Resolved:

            Development