| | |
| | | |
| | | int messageID = MSGID_JEB_SEARCH_NO_SUCH_OBJECT; |
| | | String message = getMessage(messageID, baseDN.toString()); |
| | | DN matchedDN = getMatchedDN(baseDN); |
| | | throw new DirectoryException(ResultCode.NO_SUCH_OBJECT, |
| | | message, messageID); |
| | | message, messageID, matchedDN, null); |
| | | } |
| | | |
| | | if (!isManageDsaITOperation(searchOperation)) |
| | |
| | | { |
| | | int messageID = MSGID_JEB_SEARCH_NO_SUCH_OBJECT; |
| | | String message = getMessage(messageID, baseDN.toString()); |
| | | DN matchedDN = getMatchedDN(baseDN); |
| | | throw new DirectoryException(ResultCode.NO_SUCH_OBJECT, |
| | | message, messageID); |
| | | message, messageID, matchedDN, null); |
| | | } |
| | | DatabaseEntry baseIDData = baseID.getDatabaseEntry(); |
| | | |
| | |
| | | |
| | | int messageID = MSGID_JEB_SEARCH_NO_SUCH_OBJECT; |
| | | String message = getMessage(messageID, baseDN.toString()); |
| | | DN matchedDN = getMatchedDN(baseDN); |
| | | throw new DirectoryException(ResultCode.NO_SUCH_OBJECT, |
| | | message, messageID); |
| | | message, messageID, matchedDN, null); |
| | | } |
| | | |
| | | if (!manageDsaIT) |
| | |
| | | { |
| | | int messageID = MSGID_JEB_SEARCH_NO_SUCH_OBJECT; |
| | | String message = getMessage(messageID, baseDN.toString()); |
| | | DN matchedDN = getMatchedDN(baseDN); |
| | | throw new DirectoryException(ResultCode.NO_SUCH_OBJECT, |
| | | message, messageID); |
| | | message, messageID, matchedDN, null); |
| | | } |
| | | } |
| | | |
| | |
| | | { |
| | | int msgID = MSGID_JEB_ADD_NO_SUCH_OBJECT; |
| | | String message = getMessage(msgID, entry.getDN().toString()); |
| | | DN matchedDN = getMatchedDN(baseDN); |
| | | throw new DirectoryException(ResultCode.NO_SUCH_OBJECT, |
| | | message, msgID); |
| | | message, msgID, matchedDN, null); |
| | | } |
| | | } |
| | | |
| | |
| | | // Do not expect to ever come through here. |
| | | int msgID = MSGID_JEB_DELETE_NO_SUCH_OBJECT; |
| | | String message = getMessage(msgID, leafDN.toString()); |
| | | DN matchedDN = getMatchedDN(baseDN); |
| | | throw new DirectoryException(ResultCode.NO_SUCH_OBJECT, |
| | | message, msgID); |
| | | message, msgID, matchedDN, null); |
| | | } |
| | | |
| | | // Update the referral database. |
| | |
| | | { |
| | | int msgID = MSGID_JEB_DELETE_NO_SUCH_OBJECT; |
| | | String message = getMessage(msgID, leafDN.toString()); |
| | | DN matchedDN = getMatchedDN(baseDN); |
| | | throw new DirectoryException(ResultCode.NO_SUCH_OBJECT, |
| | | message, msgID); |
| | | message, msgID, matchedDN, null); |
| | | } |
| | | |
| | | // Check that the entry exists in id2entry and read its contents. |
| | |
| | | // Do not expect to ever come through here. |
| | | int msgID = MSGID_JEB_DELETE_NO_SUCH_OBJECT; |
| | | String message = getMessage(msgID, leafDN.toString()); |
| | | DN matchedDN = getMatchedDN(baseDN); |
| | | throw new DirectoryException(ResultCode.NO_SUCH_OBJECT, |
| | | message, msgID); |
| | | message, msgID, matchedDN, null); |
| | | } |
| | | |
| | | // Update the referral database. |
| | |
| | | // The entry does not exist. |
| | | int msgID = MSGID_JEB_MODIFY_NO_SUCH_OBJECT; |
| | | String message = getMessage(msgID, entry.getDN().toString()); |
| | | throw new DirectoryException(ResultCode.NO_SUCH_OBJECT, message, msgID); |
| | | DN matchedDN = getMatchedDN(baseDN); |
| | | throw new DirectoryException(ResultCode.NO_SUCH_OBJECT, |
| | | message, msgID, matchedDN, null); |
| | | } |
| | | |
| | | // Read id2entry for the original entry. |
| | |
| | | |
| | | int messageID = MSGID_JEB_MODIFYDN_NO_SUCH_OBJECT; |
| | | String message = getMessage(messageID, oldApexDN.toString()); |
| | | DN matchedDN = getMatchedDN(baseDN); |
| | | throw new DirectoryException(ResultCode.NO_SUCH_OBJECT, |
| | | message, messageID); |
| | | message, messageID, matchedDN, null); |
| | | } |
| | | |
| | | Entry oldApexEntry = id2entry.get(txn, oldApexID); |
| | |
| | | { |
| | | int msgID = MSGID_JEB_NEW_SUPERIOR_NO_SUCH_OBJECT; |
| | | String msg = getMessage(msgID, newSuperiorDN.toString()); |
| | | throw new DirectoryException(ResultCode.NO_SUCH_OBJECT, msg, msgID); |
| | | DN matchedDN = getMatchedDN(baseDN); |
| | | throw new DirectoryException(ResultCode.NO_SUCH_OBJECT, |
| | | msg, msgID, matchedDN, null); |
| | | } |
| | | |
| | | if (newSuperiorID.compareTo(oldApexID) > 0) |
| | |
| | | } |
| | | return count; |
| | | } |
| | | |
| | | |
| | | /** |
| | | * Finds an existing entry whose DN is the closest ancestor of a given baseDN. |
| | | * |
| | | * @param baseDN the DN for which we are searching a matched DN |
| | | * @return the DN of the closest ancestor of the baseDN |
| | | * @throws DirectoryException If an error prevented the check of an |
| | | * existing entry from being performed |
| | | */ |
| | | private DN getMatchedDN(DN baseDN) |
| | | throws DirectoryException |
| | | { |
| | | DN matchedDN = null; |
| | | DN parentDN = baseDN.getParentDNInSuffix(); |
| | | while ((parentDN != null) && parentDN.isDescendantOf(getBaseDN())) |
| | | { |
| | | if (entryExists(parentDN)) |
| | | { |
| | | matchedDN = parentDN; |
| | | break; |
| | | } |
| | | parentDN = parentDN.getParentDNInSuffix(); |
| | | } |
| | | return matchedDN; |
| | | } |
| | | } |