| | |
| | | public ChangelogCursor openReadCursor(ChangeNumber changeNumber) |
| | | throws DatabaseException, Exception |
| | | { |
| | | if (changeNumber == null) |
| | | changeNumber = readFirstChange(); |
| | | if (changeNumber == null) |
| | | return null; |
| | | return new ChangelogCursor(changeNumber); |
| | | } |
| | | |
| | |
| | | { |
| | | cursor = db.openCursor(txn, null); |
| | | |
| | | DatabaseEntry key = new ChangelogKey(startingChangeNumber); |
| | | DatabaseEntry data = new DatabaseEntry(); |
| | | |
| | | if (cursor.getSearchKey(key, data, LockMode.DEFAULT) != |
| | | OperationStatus.SUCCESS) |
| | | if (startingChangeNumber != null) |
| | | { |
| | | throw new Exception("ChangeNumber not available"); |
| | | key = new ChangelogKey(startingChangeNumber); |
| | | data = new DatabaseEntry(); |
| | | |
| | | if (cursor.getSearchKey(key, data, LockMode.DEFAULT) != |
| | | OperationStatus.SUCCESS) |
| | | { |
| | | throw new Exception("ChangeNumber not available"); |
| | | } |
| | | } |
| | | } |
| | | |
| | |
| | | } |
| | | |
| | | /** |
| | | * Get the next ChangeNumber inthe database from this Cursor. |
| | | * Get the next ChangeNumber in the database from this Cursor. |
| | | * |
| | | * @return The next ChangeNumber in the database from this cursor. |
| | | * @throws DatabaseException In case of underlying database problem. |