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

Guy Paddock
27.52.2017 a2a71e1777beb48f98e64811ca6cd43286b79be3
opendj-rest2ldap/src/main/java/org/forgerock/opendj/rest2ldap/Resource.java
@@ -34,6 +34,8 @@
import java.util.ArrayList;
import java.util.Arrays;
import java.util.Collection;
import java.util.Collections;
import java.util.HashMap;
import java.util.HashSet;
import java.util.LinkedHashMap;
import java.util.LinkedHashSet;
@@ -484,7 +486,7 @@
     * @return The unique service ID for this resource, given the specified writability.
     */
    String getServiceId(boolean isReadOnly) {
        StringBuilder serviceId = new StringBuilder(this.getResourceId());
        final StringBuilder serviceId = new StringBuilder(this.getResourceId());
        if (isReadOnly) {
            serviceId.append(":read-only");
@@ -495,6 +497,21 @@
        return serviceId.toString();
    }
    /**
     * Gets a map of the sub-resources under this resource, keyed by URL template.
     *
     * @return  The map of sub-resource URL templates to sub-resources.
     */
    Map<String, SubResource> getSubResourceMap() {
        final Map<String, SubResource> result = new HashMap<>();
        for (SubResource subResource : this.subResources) {
            result.put(subResource.getUrlTemplate(), subResource);
        }
        return result;
    }
    void build(final Rest2Ldap rest2Ldap) {
        // Prevent re-entrant calls.
        if (isBuilt) {