/**
   * Registers the provided persistent search operation with this workflow element so that it will
   * be notified of any add, delete, modify, or modify DN operations that are performed.
   *
   * @param persistentSearch The persistent search operation to register with this workflow element.
   */
  void registerPersistentSearch(PersistentSearch persistentSearch) {
    PersistentSearch.CancellationCallback callback =
        new PersistentSearch.CancellationCallback() {
          public void persistentSearchCancelled(PersistentSearch psearch) {
            psearch.getSearchOperation().cancel(null);
            persistentSearches.remove(psearch);
          }
        };

    persistentSearches.add(persistentSearch);
    persistentSearch.registerCancellationCallback(callback);
  }