private AttributeCond createAttributeCond(final String schema) { AttributeCond attributeCond = SearchableFields.contains(schema) ? new AnyCond() : new AttributeCond(); attributeCond.setSchema(schema); return attributeCond; }
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; }
|| "username".equalsIgnoreCase(schema) || "name".equalsIgnoreCase(schema) ? new AnyCond() : new AttributeCond(); cond.setSchema(schema); cond.setType(type);
user = userDAO.findByUsername(authentication.getName()); } else { AttributeCond attrCond = new AttributeCond(AttributeCond.Type.EQ); attrCond.setSchema(authAttrValues.get(i)); attrCond.setExpression(authentication.getName());
user = userDAO.findByUsername(authentication.getName()); } else { AttributeCond attrCond = new AttributeCond(AttributeCond.Type.EQ); attrCond.setSchema(authAttrValues.get(i)); attrCond.setExpression(authentication.getName());
for (Map.Entry<String, String> entry : conf.getUserConf().getName().asMap().entrySet()) { if (schemaEquals(Resource.User, "name." + entry.getKey(), schema)) { attributeCond = new AttributeCond(); attributeCond.setSchema(entry.getValue()); attributeCond = new AttributeCond(); attributeCond.setSchema(entry.getValue()); for (Map.Entry<String, String> entry : address.asMap().entrySet()) { if (schemaEquals(Resource.User, "addresses." + entry.getKey(), schema)) { attributeCond = new AttributeCond(); attributeCond.setSchema(entry.getValue()); for (Map.Entry<String, String> entry : conf.getEnterpriseUserConf().asMap().entrySet()) { if (schemaEquals(Resource.EnterpriseUser, entry.getKey(), schema)) { attributeCond = new AttributeCond(); attributeCond.setSchema(entry.getValue()); && conf.getEnterpriseUserConf().getManager().getKey() != null) { attributeCond = new AttributeCond(); attributeCond.setSchema(conf.getEnterpriseUserConf().getManager().getKey());