Search in sources :

Example 1 with ValidationWhiteListSearchRequestBuilder

use of com.b2international.snowowl.core.validation.whitelist.ValidationWhiteListSearchRequestBuilder in project snow-owl by b2ihealthcare.

the class ValidateRequest method fetchWhiteListEntries.

private Multimap<String, ComponentIdentifier> fetchWhiteListEntries(BranchContext context, final Set<String> ruleIds) {
    // fetch all white list entries to determine whether an issue is whitelisted already or not
    final Multimap<String, ComponentIdentifier> whiteListedEntries = HashMultimap.create();
    ValidationWhiteListSearchRequestBuilder whiteListReq = ValidationRequests.whiteList().prepareSearch();
    // fetch whitelist entries associated with the defined rules
    if (!CompareUtils.isEmpty(ruleIds)) {
        whiteListReq.filterByRuleIds(ruleIds);
    }
    whiteListReq.all().build().execute(context).stream().forEach(whitelist -> whiteListedEntries.put(whitelist.getRuleId(), whitelist.getComponentIdentifier()));
    return whiteListedEntries;
}
Also used : ValidationWhiteListSearchRequestBuilder(com.b2international.snowowl.core.validation.whitelist.ValidationWhiteListSearchRequestBuilder) ComponentIdentifier(com.b2international.snowowl.core.ComponentIdentifier)

Aggregations

ComponentIdentifier (com.b2international.snowowl.core.ComponentIdentifier)1 ValidationWhiteListSearchRequestBuilder (com.b2international.snowowl.core.validation.whitelist.ValidationWhiteListSearchRequestBuilder)1