| | |
| | | // serverId methods |
| | | |
| | | /** |
| | | * Return the number of changes inclusive between 2 provided {@link CSN}s for |
| | | * the specified serverId and replication domain. i.e. the <code>from</code> |
| | | * and <code>to</code> CSNs are included in the count. |
| | | * <p> |
| | | * Note that: |
| | | * <ol> |
| | | * <li>If <code>from</code> is null, the count starts at the oldest CSN in the |
| | | * database.</li> |
| | | * <li>If <code>to</code> is null, the count is 0.</li> |
| | | * <li>If both from and to are present, then the count includes them both |
| | | * <code>to</code> is null, the count ends at the newest CSN in the database. |
| | | * </li> |
| | | * <li>incidentally, if both <code>from</code> and <code>to</code> are null, |
| | | * the total count of entries in the replica database is returned.</li> |
| | | * </ol> |
| | | * <h6>Example</h6> |
| | | * <p> |
| | | * Given the following replica database for baseDN "dc=example,dc=com" and |
| | | * serverId 1: |
| | | * |
| | | * <pre> |
| | | * CSN1 <= Oldest |
| | | * CSN2 |
| | | * CSN3 |
| | | * CSN4 |
| | | * CSN5 <= Newest |
| | | * </pre> |
| | | * |
| | | * Then: |
| | | * |
| | | * <pre> |
| | | * assertEquals(getCount("dc=example,dc=com", 1, CSN1, CSN1), 1); |
| | | * assertEquals(getCount("dc=example,dc=com", 1, CSN1, CSN2), 2); |
| | | * assertEquals(getCount("dc=example,dc=com", 1, CSN1, CSN5), 5); |
| | | * assertEquals(getCount("dc=example,dc=com", 1, null, CSN5), 5); |
| | | * assertEquals(getCount("dc=example,dc=com", 1, CSN1, null), 0); |
| | | * assertEquals(getCount("dc=example,dc=com", 1, null, null), 5); |
| | | * </pre> |
| | | * |
| | | * @param baseDN |
| | | * the replication domain baseDN |
| | | * @param serverId |
| | | * the serverId on which to act |
| | | * @param from |
| | | * The older CSN where to start the count |
| | | * @param to |
| | | * The newer CSN where to end the count |
| | | * @return The computed number of changes |
| | | */ |
| | | long getCount(DN baseDN, int serverId, CSN from, CSN to); |
| | | |
| | | /** |
| | | * Generates a {@link DBCursor} across all the replicaDBs for the specified |
| | | * replication domain, with all cursors starting after the provided CSN. |
| | | * <p> |