| | |
| | | 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; |
| | |
| | | * @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"); |
| | |
| | | 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) { |