use of org.apache.ranger.view.RangerPluginInfoList in project ranger by apache.
the class ServiceREST method getPluginsInfo.
@GET
@Path("/plugins/info")
@Produces({ "application/json", "application/xml" })
@PreAuthorize("@rangerPreAuthSecurityHandler.isAPIAccessible(\"" + RangerAPIList.GET_PLUGINS_INFO + "\")")
public RangerPluginInfoList getPluginsInfo(@Context HttpServletRequest request) {
if (LOG.isDebugEnabled()) {
LOG.debug("==> ServiceREST.getPluginsInfo()");
}
RangerPluginInfoList ret = null;
SearchFilter filter = searchUtil.getSearchFilter(request, pluginInfoService.getSortFields());
try {
PList<RangerPluginInfo> paginatedPluginsInfo = pluginInfoService.searchRangerPluginInfo(filter);
if (paginatedPluginsInfo != null) {
ret = new RangerPluginInfoList();
ret.setPluginInfoList(paginatedPluginsInfo.getList());
ret.setPageSize(paginatedPluginsInfo.getPageSize());
ret.setResultSize(paginatedPluginsInfo.getResultSize());
ret.setStartIndex(paginatedPluginsInfo.getStartIndex());
ret.setTotalCount(paginatedPluginsInfo.getTotalCount());
ret.setSortBy(paginatedPluginsInfo.getSortBy());
ret.setSortType(paginatedPluginsInfo.getSortType());
}
} catch (WebApplicationException excp) {
throw excp;
} catch (Throwable excp) {
LOG.error("getPluginsInfo() failed", excp);
throw restErrorUtil.createRESTException(excp.getMessage());
}
if (LOG.isDebugEnabled()) {
LOG.debug("<== ServiceREST.getPluginsInfo()");
}
return ret;
}
Aggregations