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-21, BSD License, Johannes Finckh
  • Field Details

    • path

      public WsPath path
      Path of the function.
  • Constructor Details

    • WsFunction

      public WsFunction(StaticFunc function, QueryContext qc, WebModule module)
      Constructor.
      Parameters:
      function - associated user function
      qc - query context
      module - web module
  • Method Details

    • parse

      public boolean parse(Context ctx) throws QueryException
      Description copied from class: WebFunction
      Checks 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:
      parse in class WebFunction
      Parameters:
      ctx - database context
      Returns:
      true if function contains relevant annotations
      Throws:
      QueryException - query exception
    • matches

      public boolean matches(Annotation ann, WsPath pth)
      Checks if an WebSocket request matches this annotation and path.
      Parameters:
      ann - annotation (can be null)
      pth - path to compare to (can be null)
      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:
      error in class WebFunction
      Parameters:
      msg - message
      ext - error extension
      Returns:
      exception