MCPcopy Create free account
hub / github.com/BaseXdb/basex / findWs

Method findWs

basex-api/src/main/java/org/basex/http/web/WebModules.java:178–188  ·  view source on GitHub ↗

Returns all implementations for the given WebSocket. @param ws WebSocket @param ann annotation (can be null) @return result of check @throws QueryException query exception @throws IOException I/O exception

(final WebSocket ws, final Annotation ann)

Source from the content-addressed store, hash-verified

176 * @throws IOException I/O exception
177 */
178 public ArrayList<WsFunction> findWs(final WebSocket ws, final Annotation ann)
179 throws QueryException, IOException {
180 final ArrayList<WsFunction> funcs = new ArrayList<>();
181 for(final WebModule mod : cache(ws.context).values()) {
182 for(final WsFunction func : mod.wsFunctions()) {
183 if(func.matches(ann, ws.path)) funcs.add(func);
184 }
185 }
186 Collections.sort(funcs);
187 return funcs;
188 }
189
190 /**
191 * Returns the WebSocket function that matches the current request.

Callers 2

websocketMethod · 0.95
getMethod · 0.80

Calls 6

cacheMethod · 0.95
wsFunctionsMethod · 0.80
addMethod · 0.65
valuesMethod · 0.45
matchesMethod · 0.45
sortMethod · 0.45

Tested by

no test coverage detected