Search in sources :

Example 1 with KeySearchFilter

use of org.apache.ranger.plugin.util.KeySearchFilter in project ranger by apache.

the class KmsKeyMgr method getFilteredKeyList.

public VXKmsKeyList getFilteredKeyList(HttpServletRequest request, VXKmsKeyList vXKmsKeyList) {
    List<SortField> sortFields = new ArrayList<SortField>();
    sortFields.add(new SortField(KeySearchFilter.KEY_NAME, KeySearchFilter.KEY_NAME));
    KeySearchFilter filter = getKeySearchFilter(request, sortFields);
    Predicate pred = getPredicate(filter);
    if (pred != null) {
        CollectionUtils.filter(vXKmsKeyList.getVXKeys(), pred);
    }
    return vXKmsKeyList;
}
Also used : ArrayList(java.util.ArrayList) SortField(org.apache.ranger.common.SortField) KeySearchFilter(org.apache.ranger.plugin.util.KeySearchFilter) Predicate(org.apache.commons.collections.Predicate)

Example 2 with KeySearchFilter

use of org.apache.ranger.plugin.util.KeySearchFilter in project ranger by apache.

the class KmsKeyMgr method getKeySearchFilter.

private KeySearchFilter getKeySearchFilter(HttpServletRequest request, List<SortField> sortFields) {
    if (request == null) {
        return null;
    }
    KeySearchFilter ret = new KeySearchFilter();
    if (MapUtils.isEmpty(request.getParameterMap())) {
        ret.setParams(new HashMap<String, String>());
    }
    ret.setParam(KeySearchFilter.KEY_NAME, request.getParameter(KeySearchFilter.KEY_NAME));
    extractCommonCriteriasForFilter(request, ret, sortFields);
    return ret;
}
Also used : KeySearchFilter(org.apache.ranger.plugin.util.KeySearchFilter)

Aggregations

KeySearchFilter (org.apache.ranger.plugin.util.KeySearchFilter)2 ArrayList (java.util.ArrayList)1 Predicate (org.apache.commons.collections.Predicate)1 SortField (org.apache.ranger.common.SortField)1