Class WebModules

java.lang.Object
org.basex.http.web.WebModules

public final class WebModules extends Object
This class caches RESTXQ modules found in the HTTP root directory.
Author:
BaseX Team 2005-21, BSD License, Christian Gruen
  • Method Details

    • get

      public static WebModules get(Context ctx)
      Returns the singleton instance.
      Parameters:
      ctx - database context
      Returns:
      instance
    • init

      public void init(boolean update)
      Initializes the module cache.
      Parameters:
      update - only update new modules
    • wadl

      public FElem wadl(javax.servlet.http.HttpServletRequest request)
      Returns a WADL description for all available URIs.
      Parameters:
      request - HTTP request
      Returns:
      WADL description
    • restxq

      public RestXqFunction restxq(HTTPConnection conn, QNm error) throws QueryException, IOException
      Returns a RESTXQ function that matches the current request or the specified error code best.
      Parameters:
      conn - HTTP connection
      error - error code (assigned if error function is to be called)
      Returns:
      function, or null if no function matches
      Throws:
      QueryException - query exception
      IOException - I/O exception
    • checks

      Returns permission functions that match the current request.
      Parameters:
      conn - HTTP connection
      Returns:
      list of function, ordered by relevance
      Throws:
      QueryException - query exception
      IOException - I/O exception
    • findWs

      Returns all implementations for the given WebSocket.
      Parameters:
      ws - WebSocket
      ann - annotation (can be null)
      Returns:
      result of check
      Throws:
      QueryException - query exception
      IOException - I/O exception
    • websocket

      public WsFunction websocket(WebSocket ws, Annotation ann) throws QueryException, IOException
      Returns the WebSocket function that matches the current request.
      Parameters:
      ws - WebSocket
      ann - annotation
      Returns:
      function, or null if no function matches
      Throws:
      QueryException - query exception
      IOException - I/O exception