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

Matthew Swift
15.45.2013 59562a8ce354ec5217bfd52ad930d80a618f0aed
opendj3/opendj-rest2ldap/src/main/java/org/forgerock/opendj/rest2ldap/Rest2LDAP.java
@@ -57,13 +57,11 @@
        private final List<Attribute> additionalLDAPAttributes = new LinkedList<Attribute>();
        private DN baseDN; // TODO: support template variables.
        private ConnectionFactory factory;
        private Filter falseFilter = Filter.present("1.1");
        private MVCCStrategy mvccStrategy;
        private NameStrategy nameStrategy;
        private ReadOnUpdatePolicy readOnUpdatePolicy = USE_READ_ENTRY_CONTROLS;
        private final ObjectAttributeMapper rootMapper = new ObjectAttributeMapper();
        private Schema schema = Schema.getDefaultSchema();
        private Filter trueFilter = Filter.objectClassPresent();
        Builder() {
            useEtagAttribute();
@@ -114,8 +112,7 @@
                throw new IllegalStateException("No mappings provided");
            }
            return new LDAPCollectionResourceProvider(baseDN, rootMapper, factory, nameStrategy,
                    mvccStrategy, new Config(trueFilter, falseFilter, readOnUpdatePolicy, schema),
                    additionalLDAPAttributes);
                    mvccStrategy, new Config(readOnUpdatePolicy, schema), additionalLDAPAttributes);
        }
        public Builder factory(final ConnectionFactory factory) {
@@ -125,19 +122,6 @@
        }
        /**
         * Sets the absolute false filter which should be used when querying the
         * LDAP server.
         *
         * @param filter
         *            The absolute false filter.
         * @return A reference to this builder.
         */
        public Builder falseFilter(final Filter filter) {
            this.falseFilter = ensureNotNull(filter);
            return this;
        }
        /**
         * Sets the policy which should be used in order to read an entry before
         * it is deleted, or after it is added or modified.
         *
@@ -165,19 +149,6 @@
            return this;
        }
        /**
         * Sets the absolute true filter which should be used when querying the
         * LDAP server.
         *
         * @param filter
         *            The absolute true filter.
         * @return A reference to this builder.
         */
        public Builder trueFilter(final Filter filter) {
            this.trueFilter = ensureNotNull(filter);
            return this;
        }
        public Builder useClientDNNaming(final AttributeType attribute) {
            this.nameStrategy = new DNNameStrategy(attribute);
            return this;
@@ -308,8 +279,8 @@
        @Override
        SearchRequest createSearchRequest(final Context c, final DN baseDN, final String resourceId) {
            return newSearchRequest(baseDN.child(rdn(resourceId)), SearchScope.BASE_OBJECT, c
                    .getConfig().trueFilter());
            return newSearchRequest(baseDN.child(rdn(resourceId)), SearchScope.BASE_OBJECT, Filter
                    .objectClassPresent());
        }
        @Override
@@ -406,12 +377,6 @@
     *         ...
     *     },
     *
     *     // Additional options (all are optional).
     *     "options" : {
     *         "trueFilter" : "(objectClass=*)",
     *         "falseFilter" : "(1.1=*)",
     *     },
     *
     *     // The base DN beneath which LDAP entries are to be found.
     *     "baseDN" : "ou=people,dc=example,dc=com",
     *