| | |
| | | * |
| | | * |
| | | * Copyright 2009 Sun Microsystems, Inc. |
| | | * Portions Copyright 2011 ForgeRock AS |
| | | */ |
| | | package org.opends.server.replication.server; |
| | | import static org.opends.messages.ReplicationMessages.*; |
| | |
| | | try |
| | | { |
| | | dbCloseLock.readLock().lock(); |
| | | cursor = db.openCursor(null, null); |
| | | } |
| | | catch (DatabaseException e1) |
| | | { |
| | | dbCloseLock.readLock().unlock(); |
| | | return 0; |
| | | } |
| | | try |
| | | { |
| | | try |
| | | { |
| | | cursor = db.openCursor(null, null); |
| | | DatabaseEntry key = new DatabaseEntry(); |
| | | DatabaseEntry entry = new DatabaseEntry(); |
| | | OperationStatus status = cursor.getFirst(key, entry, LockMode.DEFAULT); |
| | |
| | | str = new String(key.getData(), "UTF-8"); |
| | | } catch (UnsupportedEncodingException e) |
| | | { |
| | | // never happens |
| | | // never happens, return anyway |
| | | return 0; |
| | | } |
| | | int sn = new Integer(str); |
| | | return sn; |
| | |
| | | str = new String(key.getData(), "UTF-8"); |
| | | } catch (UnsupportedEncodingException e) |
| | | { |
| | | // never happens |
| | | // never happens, returns anyway |
| | | return 0; |
| | | } |
| | | int sn = new Integer(str); |
| | | return sn; |