mirror of https://github.com/OpenIdentityPlatform/OpenDJ.git

pgamba
02.58.2007 b48ce50fdf4d73e8be3799e3a7c6c2bf9d1b2965
opends/src/server/org/opends/server/replication/server/ReplicationDB.java
@@ -62,11 +62,11 @@
  /**
   * Creates a new database or open existing database that will be used
   * to store and retrieve changes from an LDAP server.
   * @param serverId Identifier of the LDAP server.
   * @param baseDn baseDn of the LDAP server.
   * @param replicationServer the ReplicationServer that needs to be shutdown
   * @param dbenv the Db encironemnet to use to create the db
   * @throws DatabaseException if a database problem happened
   * @param serverId The identifier of the LDAP server.
   * @param baseDn The baseDn of the replication domain.
   * @param replicationServer The ReplicationServer that needs to be shutdown.
   * @param dbenv The Db environment to use to create the db.
   * @throws DatabaseException If a database problem happened.
   */
  public ReplicationDB(Short serverId, DN baseDn,
                     ReplicationServer replicationServer,
@@ -77,8 +77,10 @@
    this.baseDn = baseDn;
    this.dbenv = dbenv;
    this.replicationServer = replicationServer;
    db = dbenv.getOrAddDb(serverId, baseDn);
    // Get or create the associated Replicationcache and Db.
    db = dbenv.getOrAddDb(serverId, baseDn,
        replicationServer.getReplicationCache(baseDn, true).getGenerationId());
  }
  /**
@@ -472,4 +474,19 @@
      cursor.delete();
    }
  }
  /**
   * Clears this change DB from the changes it contains.
   *
   * @throws Exception Throws an exception it occurs.
   * @throws DatabaseException Throws a DatabaseException when it occurs.
   */
  public void clear() throws Exception, DatabaseException
  {
    // Clears the changes
    dbenv.clearDb(this.toString());
    // Clears the reference to this serverID
    dbenv.clearServerId(baseDn, serverId);
  }
}