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

Matthew Swift
27.45.2011 f81fe89be78214a05794fb43c25b002c56aa3b3e
opendj-sdk/opendj3/opendj-ldap-sdk-examples/src/main/java/org/forgerock/opendj/examples/server/Main.java
@@ -397,9 +397,15 @@
          }
          SearchScope scope = request.getScope();
          Filter filter = request.getFilter();
          Matcher matcher = filter.matcher();
          if (scope.equals(SearchScope.BASE_OBJECT))
          {
            sendEntry(request, resultHandler, baseEntry);
            if (matcher.matches(baseEntry).toBoolean())
            {
              sendEntry(request, resultHandler, baseEntry);
            }
          }
          else if (scope.equals(SearchScope.SINGLE_LEVEL))
          {
@@ -412,6 +418,11 @@
              DN childDN = entry.getName();
              if (childDN.isChildOf(dn))
              {
                if (!matcher.matches(entry).toBoolean())
                {
                  continue;
                }
                if (!sendEntry(request, resultHandler, entry))
                {
                  // Caller has asked to stop sending results.
@@ -433,6 +444,11 @@
              DN childDN = entry.getName();
              if (childDN.isSubordinateOrEqualTo(dn))
              {
                if (!matcher.matches(entry).toBoolean())
                {
                  continue;
                }
                if (!sendEntry(request, resultHandler, entry))
                {
                  // Caller has asked to stop sending results.