title: How can you do a persistent search using the Apache 2.0.1 LDAP API in JAVA
body: <p>I am wondering if there is a way to connect to ldap (389 server) through the apache 2.0.1 java ldap api and then continuously listen for changes to a specific attribute on a set of entries (in this case people with specific qualifications)?</p>
  <p>Ideally I would like to run a query on ou=people,dc=test,dc=local
  this might initially return
  dn: uid=tester1,ou=people,dc=test,dc=local
  givenName: tester1</p>
  <p>dn: uid=tester2,ou=people,dc=test,dc=local
  givenName: tester2</p>
  <p>dn: uid=tester3,ou=people,dc=test,dc=local
  givenName: tester3</p>
  <p>If I then in the background changed tester3's givenName to userTester3 I would like to have a listener that would return some userModified event telling me that tester3 was modified.</p>
  <p><strong>As an example of what I would like to happen (psuedo code / non functioning code) I would like to do something along the lines of :</strong></p>
  <pre><code>{
   PersistentSearch ps = new PersistentSearch();
   ps.setChangeType(ChangeType.MODIFY);
   SearchRequest sr = ldaputility.createPersistentSearch(qualifiers, attributes, etc, ps);
   PersistentSearchListener psl = new PersistentSearchListener(sr){
     @Override
     public void entryChanged(Entry e){
       Log.info(&quot;The entry just changed&quot;);
    }
   }
  }
  </code></pre>
  <p>There however from what I can tell in the apache 2.0.1 api <strong>is not any persistent search listener nor is there any type of listener for search requests in general</strong> and the search request gets results and then completes.  I know that in the netscape api there is a search listener and that in the apache directory server api there is a persistent search listener. So what I am asking is does anyone know if the <strong>apache 2.0.1 ldap api</strong> supports a behavior where you make an initial query and any time the results of the query change you can have a listener that is notified of the new changes?</p>
  <p>I unfortunately have no debugging code / output since I am not even sure what code to try right now.</p>