@QueryParam("reload") boolean reload,
@ApiParam("Page size for paging") @QueryParam("ps") @DefaultValue("20") int pageSize,
@ApiParam("Page for paging, 0-based") @QueryParam("page") Integer page,
@Context HttpHeaders headers, @Context UriInfo uriInfo) throws Exception {
PluginCriteria crit = new PluginCriteria();
if (name != null) {
crit.addFilterName(name);
}
if (enabled != null) {
crit.addFilterEnabled(enabled);
}
if (version != null) {
crit.addFilterVersion(version);
}
if (deleted != null) {
crit.addFilterDeleted(deleted);
}
if (reload) {
pluginManager.update(caller);
}
if (page != null) {
crit.setPaging(page, pageSize);
}
PageList<Plugin> plugins = pluginManager.findPluginsByCriteria(caller, crit);
return paginate(headers, uriInfo, plugins, PluginRest.list(plugins), PluginRest.class).build();