| | |
| | | // map. |
| | | if (baseDNs == null || baseDNs.length != 1) |
| | | { |
| | | LocalizableMessage message = ERR_LDIF_BACKEND_MULTIPLE_BASE_DNS.get( |
| | | currentConfig.dn().toString()); |
| | | throw new ConfigException(message); |
| | | throw new ConfigException(ERR_LDIF_BACKEND_MULTIPLE_BASE_DNS.get(currentConfig.dn())); |
| | | } |
| | | |
| | | for (DN dn : baseDNs) |
| | |
| | | logger.traceException(e); |
| | | |
| | | LocalizableMessage message = ERR_BACKEND_CANNOT_REGISTER_BASEDN.get( |
| | | dn.toString(), getExceptionMessage(e)); |
| | | dn, getExceptionMessage(e)); |
| | | throw new InitializationException(message, e); |
| | | } |
| | | } |
| | |
| | | |
| | | LocalizableMessage m = ERR_LDIF_BACKEND_ERROR_CREATING_FILE.get( |
| | | tempFile.getAbsolutePath(), |
| | | currentConfig.dn().toString(), |
| | | currentConfig.dn(), |
| | | stackTraceToSingleLineString(e)); |
| | | DirectoryServer.sendAlertNotification(this, |
| | | ALERT_TYPE_LDIF_BACKEND_CANNOT_WRITE_UPDATE, m); |
| | |
| | | |
| | | LocalizableMessage m = ERR_LDIF_BACKEND_ERROR_WRITING_FILE.get( |
| | | tempFile.getAbsolutePath(), |
| | | currentConfig.dn().toString(), |
| | | currentConfig.dn(), |
| | | stackTraceToSingleLineString(e)); |
| | | DirectoryServer.sendAlertNotification(this, |
| | | ALERT_TYPE_LDIF_BACKEND_CANNOT_WRITE_UPDATE, m); |
| | |
| | | LocalizableMessage m = ERR_LDIF_BACKEND_ERROR_RENAMING_FILE.get( |
| | | tempFile.getAbsolutePath(), |
| | | ldifFile.getAbsolutePath(), |
| | | currentConfig.dn().toString(), |
| | | currentConfig.dn(), |
| | | stackTraceToSingleLineString(e)); |
| | | DirectoryServer.sendAlertNotification(this, |
| | | ALERT_TYPE_LDIF_BACKEND_CANNOT_WRITE_UPDATE, m); |
| | |
| | | parentDN = parentDN.getParentDNInSuffix(); |
| | | } |
| | | |
| | | LocalizableMessage m = ERR_LDIF_BACKEND_MODDN_NO_SUCH_SOURCE_ENTRY.get( |
| | | currentDN.toString()); |
| | | throw new DirectoryException(ResultCode.NO_SUCH_OBJECT, m, matchedDN, |
| | | null); |
| | | LocalizableMessage m = ERR_LDIF_BACKEND_MODDN_NO_SUCH_SOURCE_ENTRY.get(currentDN); |
| | | throw new DirectoryException(ResultCode.NO_SUCH_OBJECT, m, matchedDN, null); |
| | | } |
| | | |
| | | if (entryMap.containsKey(newDN)) |
| | | { |
| | | LocalizableMessage m = ERR_LDIF_BACKEND_MODDN_TARGET_ENTRY_ALREADY_EXISTS.get( |
| | | newDN.toString()); |
| | | LocalizableMessage m = ERR_LDIF_BACKEND_MODDN_TARGET_ENTRY_ALREADY_EXISTS.get(newDN); |
| | | throw new DirectoryException(ResultCode.ENTRY_ALREADY_EXISTS, m); |
| | | } |
| | | |
| | |
| | | DN entryDN = e.getName(); |
| | | if (entryMap.containsKey(entryDN)) |
| | | { |
| | | LocalizableMessage m = ERR_LDIF_BACKEND_DUPLICATE_ENTRY.get(ldifFilePath, |
| | | currentConfig.dn().toString(), entryDN.toString()); |
| | | LocalizableMessage m = |
| | | ERR_LDIF_BACKEND_DUPLICATE_ENTRY.get(ldifFilePath, currentConfig.dn(), entryDN); |
| | | logger.error(m); |
| | | reader.rejectLastEntry(m); |
| | | continue; |
| | |
| | | |
| | | if (! isBelowBaseDN) |
| | | { |
| | | LocalizableMessage m = ERR_LDIF_BACKEND_ENTRY_OUT_OF_SCOPE.get(ldifFilePath, |
| | | currentConfig.dn().toString(), entryDN.toString()); |
| | | LocalizableMessage m = ERR_LDIF_BACKEND_ENTRY_OUT_OF_SCOPE.get( |
| | | ldifFilePath, currentConfig.dn(), entryDN); |
| | | logger.error(m); |
| | | reader.rejectLastEntry(m); |
| | | continue; |
| | |
| | | DN parentDN = entryDN.getParentDNInSuffix(); |
| | | if (parentDN == null || !entryMap.containsKey(parentDN)) |
| | | { |
| | | LocalizableMessage m = ERR_LDIF_BACKEND_MISSING_PARENT.get(ldifFilePath, |
| | | currentConfig.dn().toString(), entryDN.toString()); |
| | | LocalizableMessage m = ERR_LDIF_BACKEND_MISSING_PARENT.get( |
| | | ldifFilePath, currentConfig.dn(), entryDN); |
| | | logger.error(m); |
| | | reader.rejectLastEntry(m); |
| | | continue; |
| | |
| | | currentConfig.getBaseDN().toArray(baseDNs); |
| | | if (baseDNs.length != 1) |
| | | { |
| | | throw new ConfigException(ERR_LDIF_BACKEND_MULTIPLE_BASE_DNS.get( |
| | | currentConfig.dn().toString())); |
| | | throw new ConfigException(ERR_LDIF_BACKEND_MULTIPLE_BASE_DNS.get(currentConfig.dn())); |
| | | } |
| | | |
| | | baseDNSet = new HashSet<DN>(); |
| | |
| | | // Make sure that there is only a single base DN. |
| | | if (configuration.getBaseDN().size() != 1) |
| | | { |
| | | unacceptableReasons.add(ERR_LDIF_BACKEND_MULTIPLE_BASE_DNS.get( |
| | | configuration.dn().toString())); |
| | | unacceptableReasons.add(ERR_LDIF_BACKEND_MULTIPLE_BASE_DNS.get(configuration.dn())); |
| | | configAcceptable = false; |
| | | } |
| | | |