protected final void cleanup() {
    if (cleaned) return; // been there; done that

    if (enumClnt != null) {
      enumClnt.clearSearchReply(res, homeCtx.reqCtls);
    }

    enumClnt = null;
    cleaned = true;
    if (homeCtx != null) {
      homeCtx.decEnumCount();
      homeCtx = null;
    }
  }
  /*
   * Merge the entries and/or referrals from the supplied enumeration
   * with those of the current enumeration.
   */
  protected void update(AbstractLdapNamingEnumeration<? extends NameClassPair> ne) {
    // Cleanup previous context first
    homeCtx.decEnumCount();

    // New enum will have already incremented enum count and recorded clnt
    homeCtx = ne.homeCtx;
    enumClnt = ne.enumClnt;

    // Do this to prevent referral enumeration (ne) from decrementing
    // enum count because we'll be doing that here from this
    // enumeration.
    ne.homeCtx = null;

    // Record rest of information from new enum
    posn = ne.posn;
    limit = ne.limit;
    res = ne.res;
    entries = ne.entries;
    refEx = ne.refEx;
    listArg = ne.listArg;
  }