public static SearchCond getNotLeafCond(final AttributeCond attributeCond) { SearchCond nodeCond = getLeafCond(attributeCond); nodeCond.type = Type.NOT_LEAF; return nodeCond; }
public static SearchCond getNotLeafCond(final MemberCond memberCond) { SearchCond nodeCond = getLeafCond(memberCond); nodeCond.type = Type.NOT_LEAF; return nodeCond; }
public static SearchCond getNotLeafCond(final RelationshipCond relationshipCond) { SearchCond nodeCond = getLeafCond(relationshipCond); nodeCond.type = Type.NOT_LEAF; return nodeCond; }
public static SearchCond getNotLeafCond(final PrivilegeCond privilegeCond) { SearchCond nodeCond = getLeafCond(privilegeCond); nodeCond.type = Type.NOT_LEAF; return nodeCond; }
public static SearchCond getNotLeafCond(final ResourceCond resourceCond) { SearchCond nodeCond = getLeafCond(resourceCond); nodeCond.type = Type.NOT_LEAF; return nodeCond; }
public static SearchCond getNotLeafCond(final MembershipCond membershipCond) { SearchCond nodeCond = getLeafCond(membershipCond); nodeCond.type = Type.NOT_LEAF; return nodeCond; }
public static SearchCond getNotLeafCond(final RoleCond roleCond) { SearchCond nodeCond = getLeafCond(roleCond); nodeCond.type = Type.NOT_LEAF; return nodeCond; }
protected SearchCond buildEffectiveCond(final SearchCond cond, final Set<String> dynRealmKeys) { List<SearchCond> effectiveConds = dynRealmKeys.stream().map(dynRealmKey -> { DynRealmCond dynRealmCond = new DynRealmCond(); dynRealmCond.setDynRealm(dynRealmKey); return SearchCond.getLeafCond(dynRealmCond); }).collect(Collectors.toList()); effectiveConds.add(cond); return SearchCond.getAndCond(effectiveConds); }
@Override public SearchCond getAllMatchingCond() { AnyCond idCond = new AnyCond(AttributeCond.Type.ISNOTNULL); idCond.setSchema("id"); return SearchCond.getLeafCond(idCond); }
SearchCond.getLeafCond(assignableCond), SearchCond.getLeafCond(termCond)); } else { searchCond = SearchCond.getLeafCond(assignableCond);
@Override public SearchCond visitATTR_PR(final SCIMFilterParser.ATTR_PRContext ctx) { AttributeCond cond = createAttributeCond(ctx.ATTRNAME().getText()); cond.setType(AttributeCond.Type.ISNOTNULL); return SearchCond.getLeafCond(cond); }
private <E extends Enum<?>> SearchCond complex( final String operator, final String left, final String right, final List<SCIMComplexConf<E>> items) { if (left.endsWith(".type")) { Optional<SCIMComplexConf<E>> item = items.stream(). filter(object -> object.getType().name().equals(StringUtils.strip(right, "\""))).findFirst(); if (item.isPresent()) { AttributeCond attributeCond = new AttributeCond(); attributeCond.setSchema(item.get().getValue()); attributeCond.setType(AttributeCond.Type.ISNOTNULL); return SearchCond.getLeafCond(attributeCond); } } else if (!conf.getUserConf().getEmails().isEmpty() && (MULTIVALUE.contains(left) || left.endsWith(".value"))) { List<SearchCond> orConds = new ArrayList<>(); items.forEach(item -> { AttributeCond cond = new AttributeCond(); cond.setSchema(item.getValue()); cond.setExpression(StringUtils.strip(right, "\"")); orConds.add(setOperator(cond, operator)); }); if (!orConds.isEmpty()) { return SearchCond.getOrCond(orConds); } } return null; }
private SearchCond addresses( final String operator, final String left, final String right, final List<SCIMUserAddressConf> items) { if (left.endsWith(".type") && "eq".equals(operator)) { Optional<SCIMUserAddressConf> item = items.stream(). filter(object -> object.getType().name().equals(StringUtils.strip(right, "\""))).findFirst(); if (item.isPresent()) { AttributeCond attributeCond = new AttributeCond(); attributeCond.setSchema(item.get().getFormatted()); attributeCond.setType(AttributeCond.Type.ISNOTNULL); return SearchCond.getLeafCond(attributeCond); } } else if (!conf.getUserConf().getEmails().isEmpty() && (MULTIVALUE.contains(left) || left.endsWith(".value"))) { List<SearchCond> orConds = new ArrayList<>(); items.forEach(item -> { AttributeCond cond = new AttributeCond(); cond.setSchema(item.getFormatted()); cond.setExpression(StringUtils.strip(right, "\"")); orConds.add(setOperator(cond, operator)); }); if (!orConds.isEmpty()) { return SearchCond.getOrCond(orConds); } } return null; }
cond.setExpression(expression); searchConds.add(SearchCond.getLeafCond(cond)); });
@Override public <T extends Any<?>> boolean matches(final T any, final SearchCond cond) { AnyCond keycond = new AnyCond(AttributeCond.Type.EQ); keycond.setSchema("key"); keycond.setExpression(any.getKey()); return !search(SearchCond.getAndCond(SearchCond.getLeafCond(keycond), cond), any.getType().getKind()).isEmpty(); } }
private SearchCond buildDynMembershipCond(final String baseCondFIQL, final Realm groupRealm) { AssignableCond cond = new AssignableCond(); cond.setRealmFullPath(groupRealm.getFullPath()); cond.setFromGroup(true); return SearchCond.getAndCond(SearchCond.getLeafCond(cond), SearchCondConverter.convert(baseCondFIQL)); }
attrCond.setSchema(authAttrValues.get(i)); attrCond.setExpression(authentication.getName()); List<User> users = searchDAO.search(SearchCond.getLeafCond(attrCond), AnyTypeKind.USER); if (users.size() == 1) { user = users.get(0);
AnyCond keyCond = new AnyCond(AttributeCond.Type.ISNOTNULL); keyCond.setSchema("key"); SearchCond allMatchingCond = SearchCond.getLeafCond(keyCond); int users = searchDAO.count(adminRealms, allMatchingCond, AnyTypeKind.USER); int groups = searchDAO.count(adminRealms, allMatchingCond, AnyTypeKind.GROUP);
SearchCond searchCond = SearchCond.getLeafCond(membCond);
: SearchCond.getLeafCond(attributeCond);