| | |
| | | |
| | | |
| | | |
| | | import static org.opends.server.loggers.debug.DebugLogger.debugEnabled; |
| | | import static org.opends.server.loggers.debug.DebugLogger.debugVerbose; |
| | | import static org.opends.server.loggers.debug.DebugLogger.debugInfo; |
| | | import static org.opends.server.loggers.debug.DebugLogger.debugCaught; |
| | | import static org.opends.server.loggers.debug.DebugLogger.debugProtocolElement; |
| | | import static org.opends.server.loggers.debug.DebugLogger.*; |
| | | import org.opends.server.loggers.debug.DebugTracer; |
| | | import static org.opends.server.loggers.ErrorLogger.logError; |
| | | import static org.opends.server.messages.MessageHandler.getMessage; |
| | | import static org.opends.server.messages.UtilityMessages.*; |
| | |
| | | */ |
| | | public final class LDIFReader |
| | | { |
| | | /** |
| | | * The tracer object for the debug logger. |
| | | */ |
| | | private static final DebugTracer TRACER = getTracer(); |
| | | |
| | | // The reader that will be used to read the data. |
| | | private BufferedReader reader; |
| | | |
| | |
| | | { |
| | | if (debugEnabled()) |
| | | { |
| | | debugInfo("Skipping entry %s because the DN is not one that should " + |
| | | "be included based on the include and exclude branches.", |
| | | TRACER.debugInfo("Skipping entry %s because the DN is not one that " + |
| | | "should be included based on the include and exclude branches.", |
| | | entryDN); |
| | | } |
| | | entriesRead++; |
| | |
| | | // import. |
| | | Entry entry = new Entry(entryDN, objectClasses, userAttributes, |
| | | operationalAttributes); |
| | | debugProtocolElement(DebugLogLevel.VERBOSE, entry); |
| | | TRACER.debugProtocolElement(DebugLogLevel.VERBOSE, entry); |
| | | |
| | | try |
| | | { |
| | |
| | | { |
| | | if (debugEnabled()) |
| | | { |
| | | debugInfo("Skipping entry %s because the DN is not one that " + |
| | | "should be included based on the include and exclude filters.", |
| | | entryDN); |
| | | TRACER.debugInfo("Skipping entry %s because the DN is not one " + |
| | | "that should be included based on the include and exclude " + |
| | | "filters.", entryDN); |
| | | } |
| | | entriesIgnored++; |
| | | continue; |
| | |
| | | { |
| | | if (debugEnabled()) |
| | | { |
| | | debugCaught(DebugLogLevel.ERROR, e); |
| | | TRACER.debugCaught(DebugLogLevel.ERROR, e); |
| | | } |
| | | |
| | | int msgID = MSGID_LDIF_COULD_NOT_EVALUATE_FILTERS_FOR_IMPORT; |
| | |
| | | // The value did not have a valid base64-encoding. |
| | | if (debugEnabled()) |
| | | { |
| | | debugCaught(DebugLogLevel.ERROR, e); |
| | | TRACER.debugCaught(DebugLogLevel.ERROR, e); |
| | | } |
| | | |
| | | int msgID = MSGID_LDIF_COULD_NOT_BASE64_DECODE_DN; |
| | |
| | | { |
| | | if (debugEnabled()) |
| | | { |
| | | debugCaught(DebugLogLevel.ERROR, de); |
| | | TRACER.debugCaught(DebugLogLevel.ERROR, de); |
| | | } |
| | | |
| | | int msgID = MSGID_LDIF_INVALID_DN; |
| | |
| | | { |
| | | if (debugEnabled()) |
| | | { |
| | | debugCaught(DebugLogLevel.ERROR, e); |
| | | TRACER.debugCaught(DebugLogLevel.ERROR, e); |
| | | } |
| | | |
| | | int msgID = MSGID_LDIF_INVALID_DN; |
| | |
| | | { |
| | | if (debugEnabled()) |
| | | { |
| | | debugCaught(DebugLogLevel.ERROR, de); |
| | | TRACER.debugCaught(DebugLogLevel.ERROR, de); |
| | | } |
| | | |
| | | int msgID = MSGID_LDIF_INVALID_DN; |
| | |
| | | { |
| | | if (debugEnabled()) |
| | | { |
| | | debugCaught(DebugLogLevel.ERROR, e); |
| | | TRACER.debugCaught(DebugLogLevel.ERROR, e); |
| | | } |
| | | |
| | | int msgID = MSGID_LDIF_INVALID_DN; |
| | |
| | | // The value did not have a valid base64-encoding. |
| | | if (debugEnabled()) |
| | | { |
| | | debugCaught(DebugLogLevel.ERROR, e); |
| | | TRACER.debugCaught(DebugLogLevel.ERROR, e); |
| | | } |
| | | |
| | | int msgID = MSGID_LDIF_COULD_NOT_BASE64_DECODE_DN; |
| | |
| | | { |
| | | if (debugEnabled()) |
| | | { |
| | | debugVerbose("Skipping objectclass %s for entry %s due to the " + |
| | | "import configuration.", value, entryDN); |
| | | TRACER.debugVerbose("Skipping objectclass %s for entry %s due to " + |
| | | "the import configuration.", value, entryDN); |
| | | } |
| | | return; |
| | | } |
| | |
| | | { |
| | | if (debugEnabled()) |
| | | { |
| | | debugVerbose("Skipping attribute %s for entry %s due to the import " + |
| | | "configuration.", attrName, entryDN); |
| | | TRACER.debugVerbose("Skipping attribute %s for entry %s due to the " + |
| | | "import configuration.", attrName, entryDN); |
| | | } |
| | | return; |
| | | } |
| | |
| | | { |
| | | if (debugEnabled()) |
| | | { |
| | | debugCaught(DebugLogLevel.ERROR, e); |
| | | TRACER.debugCaught(DebugLogLevel.ERROR, e); |
| | | } |
| | | } |
| | | } |
| | |
| | | { |
| | | if (debugEnabled()) |
| | | { |
| | | debugCaught(DebugLogLevel.ERROR, de); |
| | | TRACER.debugCaught(DebugLogLevel.ERROR, de); |
| | | } |
| | | int msgID = MSGID_LDIF_INVALID_DN; |
| | | String message = getMessage(msgID, lineNumber, line.toString(), |
| | |
| | | { |
| | | if (debugEnabled()) |
| | | { |
| | | debugCaught(DebugLogLevel.ERROR, e); |
| | | TRACER.debugCaught(DebugLogLevel.ERROR, e); |
| | | } |
| | | int msgID = MSGID_LDIF_INVALID_DN; |
| | | String message = getMessage(msgID, lineNumber, line.toString(), |
| | |
| | | { |
| | | if (debugEnabled()) |
| | | { |
| | | debugCaught(DebugLogLevel.ERROR, de); |
| | | TRACER.debugCaught(DebugLogLevel.ERROR, de); |
| | | } |
| | | int msgID = MSGID_LDIF_INVALID_DN; |
| | | String message = getMessage(msgID, lineNumber, line.toString(), |
| | |
| | | { |
| | | if (debugEnabled()) |
| | | { |
| | | debugCaught(DebugLogLevel.ERROR, e); |
| | | TRACER.debugCaught(DebugLogLevel.ERROR, e); |
| | | } |
| | | int msgID = MSGID_LDIF_INVALID_DN; |
| | | String message = getMessage(msgID, lineNumber, line.toString(), |
| | |
| | | // The value did not have a valid base64-encoding. |
| | | if (debugEnabled()) |
| | | { |
| | | debugCaught(DebugLogLevel.ERROR, e); |
| | | TRACER.debugCaught(DebugLogLevel.ERROR, e); |
| | | } |
| | | |
| | | int msgID = MSGID_LDIF_COULD_NOT_BASE64_DECODE_ATTR; |
| | |
| | | // The URL was malformed or had an invalid protocol. |
| | | if (debugEnabled()) |
| | | { |
| | | debugCaught(DebugLogLevel.ERROR, e); |
| | | TRACER.debugCaught(DebugLogLevel.ERROR, e); |
| | | } |
| | | |
| | | int msgID = MSGID_LDIF_INVALID_URL; |
| | |
| | | // reason. |
| | | if (debugEnabled()) |
| | | { |
| | | debugCaught(DebugLogLevel.ERROR, e); |
| | | TRACER.debugCaught(DebugLogLevel.ERROR, e); |
| | | } |
| | | |
| | | int msgID = MSGID_LDIF_URL_IO_ERROR; |
| | |
| | | { |
| | | if (debugEnabled()) |
| | | { |
| | | debugCaught(DebugLogLevel.ERROR, e); |
| | | TRACER.debugCaught(DebugLogLevel.ERROR, e); |
| | | } |
| | | } |
| | | } |