| | |
| | | |
| | | import static org.opends.messages.JebMessages.*; |
| | | import static org.opends.server.loggers.ErrorLogger.*; |
| | | import static org.opends.server.loggers.debug.DebugLogger.*; |
| | | import static org.opends.server.util.StaticUtils.*; |
| | | |
| | | import com.sleepycat.je.*; |
| | |
| | | import org.opends.server.config.ConfigException; |
| | | import org.opends.server.controls.*; |
| | | import org.opends.server.core.*; |
| | | import org.opends.server.loggers.debug.DebugTracer; |
| | | import org.forgerock.i18n.slf4j.LocalizedLogger; |
| | | import org.opends.server.protocols.ldap.LDAPResultCode; |
| | | import org.opends.server.types.*; |
| | | import org.forgerock.opendj.ldap.ByteString; |
| | |
| | | public class EntryContainer |
| | | implements ConfigurationChangeListener<LocalDBBackendCfg> |
| | | { |
| | | /** |
| | | * The tracer object for the debug logger. |
| | | */ |
| | | private static final DebugTracer TRACER = getTracer(); |
| | | private static final LocalizedLogger logger = LocalizedLogger.getLoggerForThisClass(); |
| | | |
| | | |
| | | /** |
| | |
| | | } |
| | | catch (DatabaseException de) |
| | | { |
| | | if (debugEnabled()) |
| | | { |
| | | TRACER.debugCaught(DebugLogLevel.ERROR, de); |
| | | } |
| | | logger.traceException(de); |
| | | close(); |
| | | throw de; |
| | | } |
| | |
| | | } |
| | | catch (Exception e) |
| | | { |
| | | if (debugEnabled()) |
| | | { |
| | | TRACER.debugCaught(DebugLogLevel.ERROR, e); |
| | | } |
| | | logger.traceException(e); |
| | | String str = pageRequest.getCookie().toHexString(); |
| | | LocalizableMessage msg = ERR_JEB_INVALID_PAGED_RESULTS_COOKIE.get(str); |
| | | throw new DirectoryException(ResultCode.UNWILLING_TO_PERFORM, |
| | |
| | | } |
| | | catch (DatabaseException e) |
| | | { |
| | | if (debugEnabled()) |
| | | { |
| | | TRACER.debugCaught(DebugLogLevel.ERROR, e); |
| | | } |
| | | logger.traceException(e); |
| | | } |
| | | |
| | | if (pageRequest != null) |
| | |
| | | } |
| | | catch (Exception e) |
| | | { |
| | | if (debugEnabled()) |
| | | { |
| | | TRACER.debugCaught(DebugLogLevel.ERROR, e); |
| | | } |
| | | logger.traceException(e); |
| | | String str = pageRequest.getCookie().toHexString(); |
| | | LocalizableMessage msg = ERR_JEB_INVALID_PAGED_RESULTS_COOKIE.get(str); |
| | | throw new DirectoryException(ResultCode.UNWILLING_TO_PERFORM, |
| | |
| | | } |
| | | catch (Exception e) |
| | | { |
| | | if (debugEnabled()) |
| | | { |
| | | TRACER.debugCaught(DebugLogLevel.ERROR, e); |
| | | } |
| | | logger.traceException(e); |
| | | continue; |
| | | } |
| | | } |
| | |
| | | } |
| | | catch (DatabaseException e) |
| | | { |
| | | if (debugEnabled()) |
| | | { |
| | | TRACER.debugCaught(DebugLogLevel.ERROR, e); |
| | | } |
| | | logger.traceException(e); |
| | | } |
| | | |
| | | return false; |
| | |
| | | // and added back into the attribute indexes. |
| | | newApexID = rootContainer.getNextEntryID(); |
| | | |
| | | if(debugEnabled()) |
| | | if(logger.isTraceEnabled()) |
| | | { |
| | | TRACER.debugInfo("Move of target entry requires renumbering" + |
| | | logger.trace("Move of target entry requires renumbering" + |
| | | "all entries in the subtree. " + |
| | | "Old DN: %s " + |
| | | "New DN: %s " + |
| | |
| | | { |
| | | newID = rootContainer.getNextEntryID(); |
| | | |
| | | if(debugEnabled()) |
| | | if(logger.isTraceEnabled()) |
| | | { |
| | | TRACER.debugInfo("Move of subordinate entry requires " + |
| | | logger.trace("Move of subordinate entry requires " + |
| | | "renumbering. " + |
| | | "Old DN: %s " + |
| | | "New DN: %s " + |
| | |
| | | Transaction parentTxn = null; |
| | | TransactionConfig txnConfig = null; |
| | | Transaction txn = env.beginTransaction(parentTxn, txnConfig); |
| | | if (debugEnabled()) |
| | | if (logger.isTraceEnabled()) |
| | | { |
| | | TRACER.debugVerbose("beginTransaction", "begin txnid=" + txn.getId()); |
| | | logger.trace("beginTransaction", "begin txnid=" + txn.getId()); |
| | | } |
| | | return txn; |
| | | } |
| | |
| | | if (txn != null) |
| | | { |
| | | txn.commit(); |
| | | if (debugEnabled()) |
| | | if (logger.isTraceEnabled()) |
| | | { |
| | | TRACER.debugVerbose("commit txnid=%d", txn.getId()); |
| | | logger.trace("commit txnid=%d", txn.getId()); |
| | | } |
| | | } |
| | | } |
| | |
| | | if (txn != null) |
| | | { |
| | | txn.abort(); |
| | | if (debugEnabled()) |
| | | if (logger.isTraceEnabled()) |
| | | { |
| | | TRACER.debugVerbose("abort txnid=%d", txn.getId()); |
| | | logger.trace("abort txnid=%d", txn.getId()); |
| | | } |
| | | } |
| | | } |
| | |
| | | } |
| | | catch(Exception de) |
| | | { |
| | | if (debugEnabled()) |
| | | { |
| | | TRACER.debugCaught(DebugLogLevel.ERROR, de); |
| | | } |
| | | logger.traceException(de); |
| | | |
| | | // This is mainly used during the unit tests, so it's not essential. |
| | | try |
| | |
| | | } |
| | | catch (Exception e) |
| | | { |
| | | if (debugEnabled()) |
| | | { |
| | | TRACER.debugCaught(DebugLogLevel.ERROR, de); |
| | | } |
| | | logger.traceException(de); |
| | | } |
| | | } |
| | | } |
| | |
| | | { |
| | | database.open(); |
| | | } |
| | | if(debugEnabled()) |
| | | if(logger.isTraceEnabled()) |
| | | { |
| | | TRACER.debugVerbose("Cleared the database %s", database.getName()); |
| | | logger.trace("Cleared the database %s", database.getName()); |
| | | } |
| | | } |
| | | |
| | |
| | | } |
| | | catch (Exception e) |
| | | { |
| | | if (debugEnabled()) |
| | | { |
| | | TRACER.debugCaught(DebugLogLevel.ERROR, e); |
| | | } |
| | | logger.traceException(e); |
| | | } |
| | | |
| | | // The base entry must exist for a successful result. |