private static boolean entryExists(String dn) throws SMSException {
  try {
    SearchRequest request=Requests.newSearchRequest(dn,SearchScope.BASE_OBJECT,"(objectclass=*)");
    InternalSearchOperation iso=icConn.processSearch(request);
    ResultCode resultCode=iso.getResultCode();
    if (resultCode == ResultCode.SUCCESS) {
      return true;
    }
 else     if (resultCode == ResultCode.NO_SUCH_OBJECT || resultCode == ResultCode.CLIENT_SIDE_NO_RESULTS_RETURNED) {
      if (debug.warningEnabled()) {
        debug.warning("SMSEmbeddedLdapObject:entryExists: " + dn + " does not exist. resultCode = "+ resultCode);
      }
      return false;
    }
 else {
      throw new SMSException("Failed to find entry with DN: " + dn + " LDAP error result: "+ resultCode,IUMSConstants.SMS_LDAP_OPERATION_FAILED);
    }
  }
 catch (  DirectoryException dex) {
    throw new SMSException("Failed to find entry with DN: " + dn,dex,IUMSConstants.SMS_LDAP_OPERATION_FAILED);
  }
}

private static boolean entryExists ( String dn ) throws SMSException { try { SearchRequest request = Requests . newSearchRequest ( dn , SearchScope . BASE_OBJECT , "(objectclass=*)" ) ; InternalSearchOperation iso = icConn . processSearch ( request ) ; ResultCode resultCode = iso . getResultCode ( ) ; if ( resultCode == ResultCode . SUCCESS ) { return true ; } else if ( resultCode == ResultCode . NO_SUCH_OBJECT || resultCode == ResultCode . CLIENT_SIDE_NO_RESULTS_RETURNED ) { if ( debug . warningEnabled ( ) ) { debug . warning ( "SMSEmbeddedLdapObject:entryExists: " + dn + " does not exist. resultCode = " + resultCode ) ; } return false ; } else { throw new SMSException ( "Failed to find entry with DN: " + dn + " LDAP error result: " + resultCode , IUMSConstants . SMS_LDAP_OPERATION_FAILED ) ; } } catch ( DirectoryException dex ) { throw new SMSException ( "Failed to find entry with DN: " + dn , dex , IUMSConstants . SMS_LDAP_OPERATION_FAILED ) ; } }
checks if the provided dn exists .
