public AttrCond createAttrCond()

in ext/scimv2/logic/src/main/java/org/apache/syncope/core/logic/scim/SearchCondVisitor.java [171:262]


    public AttrCond createAttrCond(final String schema) {
        AttrCond attrCond = null;

        if (schemaEquals(Resource.User, "userName", schema)) {
            attrCond = new AnyCond();
            attrCond.setSchema("username");
        } else if (resource == Resource.Group && schemaEquals(Resource.Group, "displayName", schema)) {
            attrCond = new AnyCond();
            attrCond.setSchema("name");
        } else if (schemaEquals(null, "meta.created", schema)) {
            attrCond = new AnyCond();
            attrCond.setSchema("creationDate");
        } else if (schemaEquals(null, "meta.lastModified", schema)) {
            attrCond = new AnyCond();
            attrCond.setSchema("lastChangeDate");
        }

        switch (resource) {
            case User:
                if (conf.getUserConf() != null) {
                    if (conf.getUserConf().getName() != null) {
                        for (Map.Entry<String, String> entry : conf.getUserConf().getName().asMap().entrySet()) {
                            if (schemaEquals(Resource.User, "name." + entry.getKey(), schema)) {
                                attrCond = new AttrCond();
                                attrCond.setSchema(entry.getValue());
                            }
                        }
                    }

                    for (Map.Entry<String, String> entry : conf.getUserConf().asMap().entrySet()) {
                        if (schemaEquals(Resource.User, entry.getKey(), schema)) {
                            attrCond = new AttrCond();
                            attrCond.setSchema(entry.getValue());
                        }
                    }

                    for (SCIMUserAddressConf address : conf.getUserConf().getAddresses()) {
                        for (Map.Entry<String, String> entry : address.asMap().entrySet()) {
                            if (schemaEquals(Resource.User, "addresses." + entry.getKey(), schema)) {
                                attrCond = new AttrCond();
                                attrCond.setSchema(entry.getValue());
                            }
                        }
                    }
                }

                if (conf.getEnterpriseUserConf() != null) {
                    for (Map.Entry<String, String> entry : conf.getEnterpriseUserConf().asMap().entrySet()) {
                        if (schemaEquals(Resource.EnterpriseUser, entry.getKey(), schema)) {
                            attrCond = new AttrCond();
                            attrCond.setSchema(entry.getValue());
                        }
                    }

                    if (conf.getEnterpriseUserConf().getManager() != null
                            && conf.getEnterpriseUserConf().getManager().getKey() != null) {

                        attrCond = new AttrCond();
                        attrCond.setSchema(conf.getEnterpriseUserConf().getManager().getKey());
                    }
                }

                if (conf.getExtensionUserConf() != null) {
                    for (Map.Entry<String, String> entry : conf.getExtensionUserConf().asMap().entrySet()) {
                        if (schemaEquals(Resource.ExtensionUser, entry.getKey(), schema)) {
                            attrCond = new AttrCond();
                            attrCond.setSchema(entry.getValue());
                        }
                    }
                }
                break;

            case Group:
                if (conf.getGroupConf() != null) {
                    for (Map.Entry<String, String> entry : conf.getGroupConf().asMap().entrySet()) {
                        if (schemaEquals(Resource.Group, entry.getKey(), schema)) {
                            attrCond = new AttrCond();
                            attrCond.setSchema(entry.getValue());
                        }
                    }
                }
                break;

            default:
        }

        if (attrCond == null) {
            throw new IllegalArgumentException("Could not match " + schema + " for " + resource);
        }

        return attrCond;
    }