| | |
| | | |
| | | import static org.opends.server.messages.MessageHandler.getMessage; |
| | | import static org.opends.server.messages.JebMessages.*; |
| | | import static org.opends.server.loggers.debug.DebugLogger.debugEnabled; |
| | | import static org.opends.server.loggers.debug.DebugLogger.debugCaught; |
| | | import static org.opends.server.loggers.debug.DebugLogger.debugJEAccess; |
| | | import static org.opends.server.loggers.debug.DebugLogger.debugVerbose; |
| | | import static org.opends.server.loggers.debug.DebugLogger.*; |
| | | import org.opends.server.loggers.debug.DebugTracer; |
| | | import static org.opends.server.util.ServerConstants.*; |
| | | |
| | | /** |
| | |
| | | */ |
| | | public class EntryContainer |
| | | { |
| | | /** |
| | | * The tracer object for the debug logger. |
| | | */ |
| | | private static final DebugTracer TRACER = getTracer(); |
| | | |
| | | |
| | | /** |
| | | * The name of the entry database. |
| | |
| | | { |
| | | if (debugEnabled()) |
| | | { |
| | | debugCaught(DebugLogLevel.ERROR, e); |
| | | TRACER.debugCaught(DebugLogLevel.ERROR, e); |
| | | } |
| | | close(); |
| | | throw e; |
| | |
| | | { |
| | | if (debugEnabled()) |
| | | { |
| | | debugCaught(DebugLogLevel.ERROR, e); |
| | | TRACER.debugCaught(DebugLogLevel.ERROR, e); |
| | | } |
| | | close(); |
| | | throw e; |
| | |
| | | { |
| | | if (debugEnabled()) |
| | | { |
| | | debugCaught(DebugLogLevel.ERROR, e); |
| | | TRACER.debugCaught(DebugLogLevel.ERROR, e); |
| | | } |
| | | close(); |
| | | throw e; |
| | |
| | | { |
| | | if (debugEnabled()) |
| | | { |
| | | debugCaught(DebugLogLevel.ERROR, e); |
| | | TRACER.debugCaught(DebugLogLevel.ERROR, e); |
| | | } |
| | | throw new DirectoryException(ResultCode.PROTOCOL_ERROR, |
| | | e.getMessage(), e.getMessageID(), e); |
| | |
| | | { |
| | | if (debugEnabled()) |
| | | { |
| | | debugCaught(DebugLogLevel.ERROR, e); |
| | | TRACER.debugCaught(DebugLogLevel.ERROR, e); |
| | | } |
| | | throw new DirectoryException(ResultCode.PROTOCOL_ERROR, |
| | | e.getMessage(), e.getMessageID(), e); |
| | |
| | | { |
| | | if (debugEnabled()) |
| | | { |
| | | debugCaught(DebugLogLevel.ERROR, e); |
| | | TRACER.debugCaught(DebugLogLevel.ERROR, e); |
| | | } |
| | | throw new DirectoryException(ResultCode.PROTOCOL_ERROR, |
| | | e.getMessage(), e.getMessageID(), e); |
| | |
| | | { |
| | | if (debugEnabled()) |
| | | { |
| | | debugCaught(DebugLogLevel.ERROR, e); |
| | | TRACER.debugCaught(DebugLogLevel.ERROR, e); |
| | | } |
| | | } |
| | | |
| | |
| | | { |
| | | if (debugEnabled()) |
| | | { |
| | | debugCaught(DebugLogLevel.ERROR, e); |
| | | TRACER.debugCaught(DebugLogLevel.ERROR, e); |
| | | } |
| | | } |
| | | |
| | |
| | | { |
| | | if (debugEnabled()) |
| | | { |
| | | debugCaught(DebugLogLevel.ERROR, e); |
| | | TRACER.debugCaught(DebugLogLevel.ERROR, e); |
| | | } |
| | | int msgID = MSGID_JEB_INVALID_PAGED_RESULTS_COOKIE; |
| | | String str = StaticUtils.bytesToHex(pageRequest.getCookie().value()); |
| | |
| | | { |
| | | if (debugEnabled()) |
| | | { |
| | | debugCaught(DebugLogLevel.ERROR, e); |
| | | TRACER.debugCaught(DebugLogLevel.ERROR, e); |
| | | } |
| | | } |
| | | catch (JebException e) |
| | | { |
| | | if (debugEnabled()) |
| | | { |
| | | debugCaught(DebugLogLevel.ERROR, e); |
| | | TRACER.debugCaught(DebugLogLevel.ERROR, e); |
| | | } |
| | | } |
| | | |
| | |
| | | { |
| | | if (debugEnabled()) |
| | | { |
| | | debugCaught(DebugLogLevel.ERROR, e); |
| | | TRACER.debugCaught(DebugLogLevel.ERROR, e); |
| | | } |
| | | int msgID = MSGID_JEB_INVALID_PAGED_RESULTS_COOKIE; |
| | | String str = StaticUtils.bytesToHex(pageRequest.getCookie().value()); |
| | |
| | | { |
| | | if (debugEnabled()) |
| | | { |
| | | debugCaught(DebugLogLevel.ERROR, e); |
| | | TRACER.debugCaught(DebugLogLevel.ERROR, e); |
| | | } |
| | | continue; |
| | | } |
| | |
| | | } |
| | | if (debugEnabled()) |
| | | { |
| | | debugCaught(DebugLogLevel.ERROR, deadlockException); |
| | | TRACER.debugCaught(DebugLogLevel.ERROR, deadlockException); |
| | | } |
| | | } |
| | | catch (DatabaseException databaseException) |
| | |
| | | { |
| | | if (debugEnabled()) |
| | | { |
| | | debugCaught(DebugLogLevel.ERROR, e); |
| | | TRACER.debugCaught(DebugLogLevel.ERROR, e); |
| | | } |
| | | } |
| | | |
| | |
| | | { |
| | | if (debugEnabled()) |
| | | { |
| | | debugCaught(DebugLogLevel.ERROR, e); |
| | | TRACER.debugCaught(DebugLogLevel.ERROR, e); |
| | | } |
| | | } |
| | | try |
| | |
| | | { |
| | | if (debugEnabled()) |
| | | { |
| | | debugCaught(DebugLogLevel.ERROR, e); |
| | | TRACER.debugCaught(DebugLogLevel.ERROR, e); |
| | | } |
| | | } |
| | | try |
| | |
| | | { |
| | | if (debugEnabled()) |
| | | { |
| | | debugCaught(DebugLogLevel.ERROR, e); |
| | | TRACER.debugCaught(DebugLogLevel.ERROR, e); |
| | | } |
| | | } |
| | | try |
| | |
| | | { |
| | | if (debugEnabled()) |
| | | { |
| | | debugCaught(DebugLogLevel.ERROR, e); |
| | | TRACER.debugCaught(DebugLogLevel.ERROR, e); |
| | | } |
| | | } |
| | | for (AttributeIndex index : attrIndexMap.values()) |
| | |
| | | { |
| | | if (debugEnabled()) |
| | | { |
| | | debugCaught(DebugLogLevel.ERROR, e); |
| | | TRACER.debugCaught(DebugLogLevel.ERROR, e); |
| | | } |
| | | } |
| | | } |
| | |
| | | { |
| | | if (debugEnabled()) |
| | | { |
| | | debugCaught(DebugLogLevel.ERROR, e); |
| | | TRACER.debugCaught(DebugLogLevel.ERROR, e); |
| | | } |
| | | } |
| | | } |
| | |
| | | database = env.openDatabase(txn, fullName, dbConfig); |
| | | if (debugEnabled()) |
| | | { |
| | | debugVerbose("open db=%s txnid=%d", database.getDatabaseName(), |
| | | TRACER.debugVerbose("open db=%s txnid=%d", |
| | | database.getDatabaseName(), |
| | | txn.getId()); |
| | | } |
| | | transactionCommit(txn); |
| | |
| | | database = env.openDatabase(null, fullName, dbConfig); |
| | | if (debugEnabled()) |
| | | { |
| | | debugVerbose("open db=%s txnid=none", database.getDatabaseName()); |
| | | TRACER.debugVerbose("open db=%s txnid=none", |
| | | database.getDatabaseName()); |
| | | } |
| | | } |
| | | |
| | |
| | | Transaction txn = env.beginTransaction(parentTxn, txnConfig); |
| | | if (debugEnabled()) |
| | | { |
| | | debugVerbose("beginTransaction", "begin txnid=" + txn.getId()); |
| | | TRACER.debugVerbose("beginTransaction", "begin txnid=" + txn.getId()); |
| | | } |
| | | return txn; |
| | | } |
| | |
| | | txn.commit(); |
| | | if (debugEnabled()) |
| | | { |
| | | debugVerbose("commit txnid=%d", txn.getId()); |
| | | TRACER.debugVerbose("commit txnid=%d", txn.getId()); |
| | | } |
| | | } |
| | | } |
| | |
| | | txn.abort(); |
| | | if (debugEnabled()) |
| | | { |
| | | debugVerbose("abort txnid=%d", txn.getId()); |
| | | TRACER.debugVerbose("abort txnid=%d", txn.getId()); |
| | | } |
| | | } |
| | | } |
| | |
| | | OperationStatus status = database.putNoOverwrite(txn, key, data); |
| | | if (debugEnabled()) |
| | | { |
| | | debugJEAccess(DebugLogLevel.VERBOSE, status, database, txn, key, data); |
| | | TRACER.debugJEAccess(DebugLogLevel.VERBOSE, status, database, txn, key, |
| | | data); |
| | | } |
| | | return status; |
| | | } |
| | |
| | | OperationStatus status = cursor.putNoOverwrite(key, data); |
| | | if (debugEnabled()) |
| | | { |
| | | debugJEAccess(DebugLogLevel.VERBOSE, status, |
| | | TRACER.debugJEAccess(DebugLogLevel.VERBOSE, status, |
| | | cursor.getDatabase(), null, key, data); |
| | | } |
| | | return status; |
| | |
| | | OperationStatus status = database.put(txn, key, data); |
| | | if (debugEnabled()) |
| | | { |
| | | debugJEAccess(DebugLogLevel.VERBOSE, status, database, txn, key, data); |
| | | TRACER.debugJEAccess(DebugLogLevel.VERBOSE, status, database, txn, key, |
| | | data); |
| | | } |
| | | return status; |
| | | } |
| | |
| | | OperationStatus status = cursor.put(key, data); |
| | | if (debugEnabled()) |
| | | { |
| | | debugJEAccess(DebugLogLevel.VERBOSE, status, |
| | | TRACER.debugJEAccess(DebugLogLevel.VERBOSE, status, |
| | | cursor.getDatabase(), null, key, data); |
| | | } |
| | | return status; |
| | |
| | | OperationStatus status = database.get(txn, key, data, lockMode); |
| | | if (debugEnabled()) |
| | | { |
| | | debugJEAccess(DebugLogLevel.VERBOSE, status, database, txn, key, data); |
| | | TRACER.debugJEAccess(DebugLogLevel.VERBOSE, status, database, txn, key, |
| | | data); |
| | | } |
| | | return status; |
| | | } |
| | |
| | | OperationStatus status = cursor.getSearchKey(key, data, lockMode); |
| | | if (debugEnabled()) |
| | | { |
| | | debugJEAccess(DebugLogLevel.VERBOSE, status, |
| | | TRACER.debugJEAccess(DebugLogLevel.VERBOSE, status, |
| | | cursor.getDatabase(), null, key, data); |
| | | } |
| | | return status; |
| | |
| | | OperationStatus status = database.delete(txn, key); |
| | | if (debugEnabled()) |
| | | { |
| | | debugJEAccess(DebugLogLevel.VERBOSE, status, database, txn, key, null); |
| | | TRACER.debugJEAccess(DebugLogLevel.VERBOSE, status, database, txn, key, |
| | | null); |
| | | } |
| | | return status; |
| | | } |
| | |
| | | long count = database.count(); |
| | | if (debugEnabled()) |
| | | { |
| | | debugJEAccess(DebugLogLevel.VERBOSE, OperationStatus.SUCCESS, |
| | | TRACER.debugJEAccess(DebugLogLevel.VERBOSE, OperationStatus.SUCCESS, |
| | | database, null, null, null); |
| | | } |
| | | return count; |