| | |
| | | import org.forgerock.opendj.ldap.RDN; |
| | | import org.forgerock.opendj.ldap.schema.AttributeType; |
| | | import org.forgerock.opendj.ldap.schema.CoreSchema; |
| | | import org.forgerock.opendj.ldap.schema.ObjectClass; |
| | | import org.forgerock.util.Pair; |
| | | import org.opends.server.api.plugin.PluginResult; |
| | | import org.opends.server.core.DirectoryServer; |
| | | import org.opends.server.core.PluginConfigManager; |
| | |
| | | import org.opends.server.types.Attributes; |
| | | import org.opends.server.types.Entry; |
| | | import org.opends.server.types.LDIFImportConfig; |
| | | import org.forgerock.opendj.ldap.schema.ObjectClass; |
| | | import org.opends.server.types.RawModification; |
| | | |
| | | /** |
| | |
| | | // read and return the next entry. |
| | | continue; |
| | | } |
| | | else if (!importConfig.includeEntry(entryDN)) |
| | | |
| | | entriesRead.incrementAndGet(); |
| | | Pair<Boolean, LocalizableMessage> includeResult = importConfig.includeEntry(entryDN); |
| | | if (!includeResult.getFirst()) |
| | | { |
| | | logger.trace("Skipping entry %s because the DN is not one that " |
| | | + "should be included based on the include and exclude branches.", entryDN); |
| | | entriesRead.incrementAndGet(); |
| | | logToSkipWriter(lines, ERR_LDIF_SKIP.get(entryDN)); |
| | | logToSkipWriter(lines, includeResult.getSecond()); |
| | | continue; |
| | | } |
| | | else |
| | | { |
| | | entriesRead.incrementAndGet(); |
| | | } |
| | | |
| | | // Create the entry and see if it is one that should be included in the import. |
| | | final Entry entry = createEntry(entryDN, lines, checkSchema); |
| | | if (!isIncludedInImport(entry,lines) |
| | | || !invokeImportPlugins(entry, lines)) |
| | | { |
| | | continue; |
| | | } |
| | | validateAgainstSchemaIfNeeded(checkSchema, entry, lines); |
| | | |
| | | // The entry should be included in the import, so return it. |
| | | validateAgainstSchemaIfNeeded(checkSchema, entry, lines); |
| | | return entry; |
| | | } |
| | | } |
| | |
| | | { |
| | | try |
| | | { |
| | | if (!importConfig.includeEntry(entry)) |
| | | Pair<Boolean, LocalizableMessage> includeResult = importConfig.includeEntry(entry); |
| | | if (!includeResult.getFirst()) |
| | | { |
| | | final DN entryDN = entry.getName(); |
| | | logger.trace("Skipping entry %s because the DN is not one that " |
| | | + "should be included based on the include and exclude filters.", entryDN); |
| | | logToSkipWriter(lines, ERR_LDIF_SKIP.get(entryDN)); |
| | | logToSkipWriter(lines, includeResult.getSecond()); |
| | | return false; |
| | | } |
| | | return true; |