Package com.isode.dsapi.config
Class GDAMEntry
java.lang.Object
com.isode.dsapi.config.ManagedObject
com.isode.dsapi.config.GDAMEntry
GDAMEntry represents a GDAM database entry.
- Since:
- 15.0
-
Field Summary
Fields inherited from class com.isode.dsapi.config.ManagedObject
logger
-
Method Summary
Modifier and TypeMethodDescriptionstatic GDAMEntry
create
(IsodeDirectorySession ds, String name, String path, GDAMType gdamtype) Create a new GDAM and update DB.createIndex
(AttributeType at, IndexEntry.IndexMatchType matchType) Create a new index and update DB.boolean
deleteIndex
(String name) Remove an index entry and update DB.Get the GDAM type (bagdam, imgdam, etc).Get the hash map of indexes.getName()
Get the GDAM name (value of 'cn').void
Load values from an entry.void
Loads the indexes for this GDAM entry from the DB.void
setBuildIndex
(Boolean value) Set build index flag.void
setCheckpointInterval
(Integer value) Set the desired interval between checkpoints, which overrides isodeCheckpointSchedule if specified (IMGDAM)void
setCheckpointSchedule
(List<String> list) Set the schedule of times to perform checkpoint (expressed in seconds past midnight local time) (IMGDAM)void
setMaxEntriesPerFile
(Integer value) Set the maximum number of entries written to each snapshotted LDIF file (IMGDAM)void
setMaxLoadThreads
(Integer value) Set the maximum number of threads used to load data at startup (IMGDAM)toString()
static void
validateName
(String gdamName) Validates given GDAM name.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
-
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 GDAMEntry create(IsodeDirectorySession ds, String name, String path, GDAMType gdamtype) throws ConfigOpFailedException, ReadFailedException Create a new GDAM and update DB.- Parameters:
ds
- Directory session.name
- GDAM name.path
- Path to directory where GDAM will be created (on the DSA system). The path provided can be absolute or a single sub-directory name (that will be treated as relative to the DSA's directory on the filesystem).gdamtype
- Type of GDAM: e.g. BAGDAM or IMGDAM- Returns:
- created GDAM 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.
-
loadIndexes
Loads the indexes for this GDAM entry from the DB.- Throws:
ConfigOpFailedException
- if mandatory attributes are not loadedReadFailedException
- if there is an error while reading data from the directory server
-
createIndex
public IndexEntry createIndex(AttributeType at, IndexEntry.IndexMatchType matchType) throws ConfigOpFailedException, ReadFailedException Create a new index and update DB.- Parameters:
at
- attribute typematchType
- match type- Returns:
- created index entry
- Throws:
ReadFailedException
- if there is a problem on reading the committed entry back.ConfigOpFailedException
- if there is any other problem on applying the changes.
-
deleteIndex
Remove an index entry and update DB.- Parameters:
name
- index name- Returns:
- TRUE if the index entry corresponding to the name was found, FALSE otherwise
- Throws:
ConfigOpFailedException
- if the operation failed.
-
getIndexes
Get the hash map of indexes.- Returns:
- hash map of indexes
-
getName
Get the GDAM name (value of 'cn').- Returns:
- GDAM name
-
getGDAMType
Get the GDAM type (bagdam, imgdam, etc). This can't be changed.- Returns:
- GDAMType
-
getMaxLoadThreads
- Returns:
- Maximum number of threads used to load data at startup (IMGDAM)
-
getMaxEntriesPerFile
- Returns:
- Maximum number of entries written to each snapshot'ed LDIF file (IMGDAM)
-
getCheckpointSchedule
- Returns:
- Schedule of times to perform checkpoint (expressed in seconds past midnight local time) (IMGDAM)
-
getCheckpointInterval
- Returns:
- Desired interval between checkpoints in seconds, which overrides isodeCheckpointSchedule if specified (IMGDAM)
-
setMaxLoadThreads
Set the maximum number of threads used to load data at startup (IMGDAM)- Parameters:
value
- Value to set. If null, attribute is deleted.
-
setMaxEntriesPerFile
Set the maximum number of entries written to each snapshotted LDIF file (IMGDAM)- Parameters:
value
- Value to set. If null, attribute is deleted.
-
setCheckpointSchedule
Set the schedule of times to perform checkpoint (expressed in seconds past midnight local time) (IMGDAM)- Parameters:
list
- List of values to set, or null/empty list to delete attribute.- Throws:
BadValueException
- if any value is not an integer
-
setCheckpointInterval
Set the desired interval between checkpoints, which overrides isodeCheckpointSchedule if specified (IMGDAM)- Parameters:
value
- Value to set. If null, attribute is deleted.
-
getBuildIndex
- Returns:
- The current value of the build index flag as set by the user. This flag is always false when read from the directory. It is set to true before a commit operation to indicate to the directory to (re)build its indexes for this GDAM entry.
-
setBuildIndex
Set build index flag. This flag is only set locally at this point and not updated in the DB. The DB would be updated in aManagedObject.commit()
operation.Please note that committing other attributes with this virtual attribute is not supported in the DSA. Thus ensure that a commit containing this attribute only contains the change for this attribute.
- Parameters:
value
- Value to set, null to clear.
-
toString
-
validateName
Validates given GDAM name.- Parameters:
gdamName
- GDAM name- Throws:
ConfigOpFailedException
- in case name is invalid
-