mirror of https://github.com/OpenIdentityPlatform/OpenDJ.git

Matthew Swift
26.12.2012 58ffacee660a4eb792f49dd311a4e2ddda05afad
opendj3/opendj-rest2ldap/src/main/java/org/forgerock/opendj/rest2ldap/DefaultAttributeMapper.java
@@ -67,14 +67,23 @@
        }
    }
    public void getLDAPAttributes(Set<String> ldapAttributes, JsonPointer resourceAttribute) {
        String name = resourceAttribute.leaf();
        if (name != null) {
    public void getLDAPAttributes(JsonPointer jsonAttribute, Set<String> ldapAttributes) {
        switch (jsonAttribute.size()) {
        case 0:
            // Requested everything.
            if (!includedAttributes.isEmpty()) {
                ldapAttributes.addAll(includedAttributes.values());
            } else {
                // All user attributes.
                ldapAttributes.add("*");
            }
            break;
        default:
            String name = jsonAttribute.get(0);
            if (isIncludedAttribute(name)) {
                ldapAttributes.add(name);
            } else {
                // FIXME: log something or return a ResourceException?
            }
            break;
        }
    }