Package com.isode.dsapi.config
Class LDAPChangelogEntry
java.lang.Object
com.isode.dsapi.config.ManagedObject
com.isode.dsapi.config.LDAPChangelogEntry
This class wraps the LDAP Changelog entry stored in the directory session.
- Since:
- 15.0
-
Field Summary
Fields inherited from class com.isode.dsapi.config.ManagedObject
logger
-
Constructor Summary
ConstructorsConstructorDescriptionLDAPChangelogEntry
(Entry entry, IsodeDirectorySession ds) Construct from the entry object. -
Method Summary
Modifier and TypeMethodDescriptionstatic LDAPChangelogEntry
create
(IsodeDirectorySession ds, int maxEntryAge, int prunePeriod) Construct Changelog entry (which will be something like "cn=changeover,cn=config").int
Get the maximum entry ageint
Get the prune periodvoid
Load values from an entry.void
setDatabasePath
(String newPath) Set database directoryvoid
setMaxEntryAge
(int age) Sets the maximum entry agevoid
setPrunePeriod
(int period) Methods inherited from class com.isode.dsapi.config.ManagedObject
addAttribute, addAttribute, addAttribute, addAttributeValue, addAttributeValue, addEntry, addOC, checkMandatory, checkMandatory, checkMandatory, checkMandatory, commit, commitNoRefresh, createAP, createAttributeType, createDN, createPA, createRDN, createRDN, getAttribute, getAttributeDefaultWhenNull, getDN, getIsodeDirectorySession, getMultiValueBer, getMultiValuedInteger, getMultiValuedInteger, getMultiValuedString, getMultiValuedString, getPA, getValue, getValueAttrTypeFromOID, getValueBer, getValueBoolean, getValueDate, getValueDate, getValueDN, getValueInteger, getValueInteger, getValueString, getValueString, getValueStringFromAttribute, hasAttributeChanged, hasChanges, remove, removeAttr, removeStringValue, reset, reset, updateAttr, updateAttr, updateAttr, updateBoolean, updateDN, updateInteger, updateMultiValuedBER, updateMultiValuedInteger, updateMultiValuedString, updatePA, updatePA, updateString
-
Constructor Details
-
LDAPChangelogEntry
Construct from the entry object.- Parameters:
entry
- Entry representing the failover config.ds
- Isode directory session- Throws:
ConfigOpFailedException
- if mandatory attributes are not loaded
-
-
Method Details
-
load
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 classManagedObject
- 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]
- 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
- Returns:
- the disk database directory, will never be null.
-
setDatabasePath
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)
-