Class LDAPChangelogEntry

java.lang.Object
com.isode.dsapi.config.ManagedObject
com.isode.dsapi.config.LDAPChangelogEntry

public class LDAPChangelogEntry extends ManagedObject
This class wraps the LDAP Changelog entry stored in the directory session.
Since:
15.0
  • Constructor Details

  • Method Details

    • load

      public void load(Entry entry) throws ConfigOpFailedException
      Description copied from class: ManagedObject
      Load values from an entry. No directory operation should be done in this method.

      Mandatory variables are assigned only after everything is ok. This is done so during re-loading, if there are exceptions and even then the object is used, there is no crash by using mandatory variables that are assumed to have non-null values.

      Specified by:
      load in class ManagedObject
      Parameters:
      entry - Entry representing the object, could be null if the existing entry has to be reloaded
      Throws:
      ConfigOpFailedException - if mandatory attributes are not loaded
    • create

      public static LDAPChangelogEntry create(IsodeDirectorySession ds, int maxEntryAge, int prunePeriod) throws ConfigOpFailedException, ReadFailedException
      Construct Changelog entry (which will be something like "cn=changeover,cn=config"). This is used when you're enabling LDAP changelogging.

      The returned result will contain the following attributes

      • objectClass = top, icChangeLogGdam
      • diskDatabaseDirectory = "changelog" (hard-coded)
      • changeLogMaxEntryAge = [seconds]</code
      • changeLogPrunePeriod = [seconds]
      i.e., the "diskDatabaseDirectory" is currently always hard-coded to be "changelog".
      Parameters:
      ds - Directory session.
      maxEntryAge - the value for changeLogMaxEntryAge.
      prunePeriod - the value for changeLogPrunePeriod.
      Returns:
      created Changelog entry
      Throws:
      ReadFailedException - if there is a problem on reading the committed entry back.
      ConfigOpFailedException - if there is a problem on applying the changes to the directory.
    • getDatabasePath

      public String getDatabasePath()
      Returns:
      the disk database directory, will never be null.
    • setDatabasePath

      public void setDatabasePath(String newPath)
      Set database directory
      Parameters:
      newPath - new directory path; must not be null.
    • getMaxEntryAge

      public int getMaxEntryAge()
      Get the maximum entry age
      Returns:
      maximum entry age
    • setMaxEntryAge

      public void setMaxEntryAge(int age)
      Sets the maximum entry age
      Parameters:
      age - the new age, in seconds
    • getPrunePeriod

      public int getPrunePeriod()
      Get the prune period
      Returns:
      the prune period
    • setPrunePeriod

      public void setPrunePeriod(int period)