| | |
| | | * |
| | | * |
| | | * Copyright 2006-2008 Sun Microsystems, Inc. |
| | | * Portions Copyright 2014 ForgeRock AS |
| | | */ |
| | | package org.opends.server.backends; |
| | | |
| | |
| | | Entry e = entry.duplicate(false); |
| | | |
| | | // See if the target entry already exists. If so, then fail. |
| | | DN entryDN = e.getDN(); |
| | | DN entryDN = e.getName(); |
| | | if (entryMap.containsKey(entryDN)) |
| | | { |
| | | Message message = |
| | |
| | | Entry e = newEntry.duplicate(false); |
| | | |
| | | // Make sure the entry exists. If not, then throw an exception. |
| | | DN entryDN = e.getDN(); |
| | | DN entryDN = e.getName(); |
| | | if (! entryMap.containsKey(entryDN)) |
| | | { |
| | | Message message = |
| | |
| | | |
| | | |
| | | // Make sure that no entry exists with the new DN. |
| | | if (entryMap.containsKey(e.getDN())) |
| | | if (entryMap.containsKey(e.getName())) |
| | | { |
| | | Message message = |
| | | ERR_MEMORYBACKEND_ENTRY_ALREADY_EXISTS.get(String.valueOf(e.getDN())); |
| | | Message message = ERR_MEMORYBACKEND_ENTRY_ALREADY_EXISTS.get( |
| | | String.valueOf(e.getName())); |
| | | throw new DirectoryException(ResultCode.ENTRY_ALREADY_EXISTS, message); |
| | | } |
| | | |
| | |
| | | boolean matchFound = false; |
| | | for (DN dn : baseDNs) |
| | | { |
| | | if (dn.isAncestorOf(e.getDN())) |
| | | if (dn.isAncestorOf(e.getName())) |
| | | { |
| | | matchFound = true; |
| | | break; |
| | |
| | | |
| | | |
| | | // Make sure that the parent of the new entry exists. |
| | | DN parentDN = e.getDN().getParentDNInSuffix(); |
| | | DN parentDN = e.getName().getParentDNInSuffix(); |
| | | if ((parentDN == null) || (! entryMap.containsKey(parentDN))) |
| | | { |
| | | Message message = ERR_MEMORYBACKEND_RENAME_PARENT_DOESNT_EXIST.get( |
| | |
| | | { |
| | | for (Entry entry : entryMap.values()) |
| | | { |
| | | entryDN = entry.getDN(); |
| | | entryDN = entry.getName(); |
| | | ldifWriter.writeEntry(entry); |
| | | } |
| | | } |