From a2d67f674f7e80dcd9ca901ea63df41ef47f4214 Mon Sep 17 00:00:00 2001
From: vharseko <vharseko@openam.org.ru>
Date: Wed, 22 Nov 2017 05:08:57 +0000
Subject: [PATCH] Merge pull request #3 from GuyPaddock/wren/feature/subtree-flattening

---
 opendj-rest2ldap/src/main/java/org/forgerock/opendj/rest2ldap/SubResource.java |   27 +++++++++++++++++++++++----
 1 files changed, 23 insertions(+), 4 deletions(-)

diff --git a/opendj-rest2ldap/src/main/java/org/forgerock/opendj/rest2ldap/SubResource.java b/opendj-rest2ldap/src/main/java/org/forgerock/opendj/rest2ldap/SubResource.java
index 0e61043..4c96470 100644
--- a/opendj-rest2ldap/src/main/java/org/forgerock/opendj/rest2ldap/SubResource.java
+++ b/opendj-rest2ldap/src/main/java/org/forgerock/opendj/rest2ldap/SubResource.java
@@ -12,7 +12,7 @@
  * information: "Portions copyright [year] [name of copyright owner]".
  *
  * Copyright 2016 ForgeRock AS.
- *
+ * Portions Copyright 2017 Rosie Applications, Inc.
  */
 package org.forgerock.opendj.rest2ldap;
 
@@ -60,9 +60,10 @@
 
     String urlTemplate = "";
     String dnTemplateString = "";
-    boolean isReadOnly = false;
-    Rest2Ldap rest2Ldap;
-    Resource resource;
+
+    protected boolean isReadOnly = false;
+    protected Rest2Ldap rest2Ldap;
+    protected Resource resource;
 
     SubResource(final String resourceId) {
         this.resourceId = resourceId;
@@ -80,9 +81,27 @@
 
     @Override
     public final String toString() {
+        return getUrlTemplate();
+    }
+
+    /**
+     * Gets the URL template that must match for this sub-resource to apply to a given request.
+     *
+     * @return  The URL template for this sub-resource.
+     */
+    public String getUrlTemplate() {
         return urlTemplate;
     }
 
+    /**
+     * Gets whether or not this sub-resource has been configured for read-only access.
+     *
+     * @return  {@code true} if the sub-resource is read-only; {@code false} otherwise.
+     */
+    public boolean isReadOnly() {
+        return isReadOnly;
+    }
+
     final Resource getResource() {
         return resource;
     }

--
Gitblit v1.10.0