Binds the function parameters. @param msg message (can be null; otherwise string or byte array) @param values header values @param qc query context @return arguments @throws QueryException query exception
(final Object msg, final Map<String, Value> values,
final QueryContext qc)
| 88 | * @throws QueryException query exception |
| 89 | */ |
| 90 | Expr[] bind(final Object msg, final Map<String, Value> values, |
| 91 | final QueryContext qc) throws QueryException { |
| 92 | |
| 93 | final Expr[] args = new Expr[function.arity()]; |
| 94 | if(msg != null) values.put("message", msg instanceof final byte[] bytes ? B64.get(bytes) : |
| 95 | Str.get((String) msg)); |
| 96 | |
| 97 | for(final WebParam param : headerParams) { |
| 98 | final Value v = values.get(param.name()); |
| 99 | bind(param.var(), args, v == null || v.isEmpty() ? param.value() : v, qc, |
| 100 | "Value of '" + param.name() + "'"); |
| 101 | } |
| 102 | if(message != null) { |
| 103 | bind(message.var(), args, values.get(message.name()), qc, "Message"); |
| 104 | } |
| 105 | return args; |
| 106 | } |
| 107 | |
| 108 | /** |
| 109 | * Checks if an WebSocket request matches this annotation and path. |