private static boolean entryExists(String dn) throws SMSException {
  boolean entryExists=false;
  try (Connection conn=getConnection(adminPrincipal)){
    conn.searchSingleEntry(LDAPRequests.newSingleEntrySearchRequest(dn,OU_ATTR));
    entryExists=true;
  }
 catch (  EntryNotFoundException e) {
    debug.warning("SMSLdapObject:entryExists: {} does not exist",dn);
  }
catch (  LdapException e) {
    throw new SMSException("Unable to find entry with DN: " + dn,e,IUMSConstants.SMS_LDAP_OPERATION_FAILED);
  }
  return entryExists;
}

private static boolean entryExists ( String dn ) throws SMSException { boolean entryExists = false ; try ( Connection conn = getConnection ( adminPrincipal ) ) { conn . searchSingleEntry ( LDAPRequests . newSingleEntrySearchRequest ( dn , OU_ATTR ) ) ; entryExists = true ; } catch ( EntryNotFoundException e ) { debug . warning ( "SMSLdapObject:entryExists: {} does not exist" , dn ) ; } catch ( LdapException e ) { throw new SMSException ( "Unable to find entry with DN: " + dn , e , IUMSConstants . SMS_LDAP_OPERATION_FAILED ) ; } return entryExists ; }
checks if the provided dn exists .
