Package org.basex.http.ws
Class WsFunction
- java.lang.Object
-
- org.basex.http.web.WebFunction
-
- org.basex.http.ws.WsFunction
-
- All Implemented Interfaces:
Comparable<WebFunction>
public final class WsFunction extends WebFunction
This class represents a single WebSocket function.- Author:
- BaseX Team 2005-23, BSD License, Johannes Finckh
-
-
Field Summary
Fields Modifier and Type Field Description WsPathpathPath of the function.-
Fields inherited from class org.basex.http.web.WebFunction
function, headerParams, module, sopts
-
-
Constructor Summary
Constructors Constructor Description WsFunction(StaticFunc function, WebModule module, QueryContext qc)Constructor.
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description intcompareTo(WebFunction func)QueryExceptionerror(String msg, Object... ext)Creates an exception with the specified message.booleanmatches(Annotation definition, WsPath pth)Checks if an WebSocket request matches this annotation and path.booleanparseAnnotations(Context ctx)Checks a function for REST and permission annotations.-
Methods inherited from class org.basex.http.web.WebFunction
bind, checkParsed, checkVariable, checkVariable, toString, toString
-
-
-
-
Field Detail
-
path
public WsPath path
Path of the function.
-
-
Constructor Detail
-
WsFunction
public WsFunction(StaticFunc function, WebModule module, QueryContext qc)
Constructor.- Parameters:
function- associated user functionmodule- web moduleqc- query context
-
-
Method Detail
-
parseAnnotations
public boolean parseAnnotations(Context ctx) throws QueryException
Description copied from class:WebFunctionChecks a function for REST and permission annotations. This function is called both when a module is parsed, and when the function is prepared for evaluation.- Specified by:
parseAnnotationsin classWebFunction- Parameters:
ctx- database context- Returns:
trueif function contains relevant annotations- Throws:
QueryException- query exception
-
matches
public boolean matches(Annotation definition, WsPath pth)
Checks if an WebSocket request matches this annotation and path.- Parameters:
definition- annotation definition (can benull)pth- path to compare to (can benull)- Returns:
- boolean result of check
-
compareTo
public int compareTo(WebFunction func)
-
error
public QueryException error(String msg, Object... ext)
Creates an exception with the specified message.- Specified by:
errorin classWebFunction- Parameters:
msg- messageext- error extension- Returns:
- exception
-
-