Package org.basex.http.web
Class WebModules
java.lang.Object
org.basex.http.web.WebModules
This class caches RESTXQ modules found in the HTTP root directory.
- Author:
- BaseX Team 2005-21, BSD License, Christian Gruen
-
Method Summary
Modifier and TypeMethodDescriptionchecks(HTTPConnection conn) Returns permission functions that match the current request.findWs(WebSocket ws, Annotation ann) Returns all implementations for the given WebSocket.static WebModulesReturns the singleton instance.voidinit(boolean update) Initializes the module cache.restxq(HTTPConnection conn, QNm error) Returns a RESTXQ function that matches the current request or the specified error code best.wadl(javax.servlet.http.HttpServletRequest request) Returns a WADL description for all available URIs.websocket(WebSocket ws, Annotation ann) Returns the WebSocket function that matches the current request.
-
Method Details
-
get
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
Returns a WADL description for all available URIs.- Parameters:
request- HTTP request- Returns:
- WADL description
-
restxq
Returns a RESTXQ function that matches the current request or the specified error code best.- Parameters:
conn- HTTP connectionerror- error code (assigned if error function is to be called)- Returns:
- function, or
nullif no function matches - Throws:
QueryException- query exceptionIOException- 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 exceptionIOException- I/O exception
-
findWs
public ArrayList<WsFunction> findWs(WebSocket ws, Annotation ann) throws QueryException, IOException Returns all implementations for the given WebSocket.- Parameters:
ws- WebSocketann- annotation (can benull)- Returns:
- result of check
- Throws:
QueryException- query exceptionIOException- I/O exception
-
websocket
Returns the WebSocket function that matches the current request.- Parameters:
ws- WebSocketann- annotation- Returns:
- function, or
nullif no function matches - Throws:
QueryException- query exceptionIOException- I/O exception
-