Returns RESTXQ and permissions functions that match the current request. @param conn HTTP connection @param error error code (assigned if error function is to be called) @param perm permission flag @return list of matching functions, ordered by specifity @throws QueryException query exception @throw
(final HTTPConnection conn, final QNm error, final boolean perm)
| 142 | * @throws IOException I/O exception |
| 143 | */ |
| 144 | private List<RestXqFunction> find(final HTTPConnection conn, final QNm error, final boolean perm) |
| 145 | throws QueryException, IOException { |
| 146 | |
| 147 | // collect and sort all functions |
| 148 | final ArrayList<RestXqFunction> list = new ArrayList<>(); |
| 149 | for(final WebModule module : cache(conn.context).values()) { |
| 150 | for(final RestXqFunction func : module.functions()) { |
| 151 | if(func.matches(conn, error, perm)) list.add(func); |
| 152 | } |
| 153 | } |
| 154 | // sort by specifity |
| 155 | Collections.sort(list); |
| 156 | return list; |
| 157 | } |
| 158 | |
| 159 | /** |
| 160 | * Returns permission functions that match the current request. |
no test coverage detected