Package com.isode.dsapi.config
Class IndexEntry
java.lang.Object
com.isode.dsapi.config.ManagedObject
com.isode.dsapi.config.IndexEntry
IndexEntry represents an index entry in a GDAM. Please note that a GDAM can
contain many index entries. Index entries are never modified but can be added
and removed.
Examples of index entry names in the DB are "cn=index1.approx",
"cn=index2.eq". The name as it is stored in the DB can be retrieved using the
method getName()
. However, for ease of use, the attribute type and
match type are extracted from the name and can be obtained using the methods
getAttrType()
, getAttrTypeString()
,
getMatchType()
, getMatchTypeString()
.
cn=gdam // GDAM entry | +--- cn=index1.approx // child of cn=config | +--- cn=index2.eq // child of cn=config
- Since:
- 15.0
-
Nested Class Summary
Nested ClassesModifier and TypeClassDescriptionstatic enum
Index match types.static enum
Index state. -
Field Summary
Fields inherited from class com.isode.dsapi.config.ManagedObject
logger
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionstatic IndexEntry
create
(IsodeDirectorySession ds, DN gdamDN, AttributeType attrType, IndexEntry.IndexMatchType matchType, GDAMType gdamType) Create a new index and update DB.Get the indexed attribute type.Get the indexed attribute type name.Get the index state.Get the index state as a string.Get the index match type.Get the index match type as a string.getName()
Get the index name (value of 'cn').void
Load values from an entry.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
-
IndexEntry
Constructor.- Parameters:
entry
- Entry to create from. Must not be null.ds
- Isode directory session. Must not be null.- 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 IndexEntry create(IsodeDirectorySession ds, DN gdamDN, AttributeType attrType, IndexEntry.IndexMatchType matchType, GDAMType gdamType) throws ConfigOpFailedException, ReadFailedException Create a new index and update DB.- Parameters:
ds
- Directory session. Must not be null.gdamDN
- GDAM DN. Must not be null.attrType
- Attribute type. Must not be null.matchType
- Match type. Must not be null.gdamType
- GDAM type (IMGDAM as BAGDAM is now not supported), not null.- Returns:
- created index entry; will never be null.
- Throws:
ReadFailedException
- if there is a problem on reading the committed entry back.ConfigOpFailedException
- if there is any other problem on applying the changes.
-
getName
Get the index name (value of 'cn').- Returns:
- Index name, which will never be null.
-
getAttrType
Get the indexed attribute type.- Returns:
- indexed attribute type, which will never be null.
-
getAttrTypeString
Get the indexed attribute type name.- Returns:
- indexed attribute type name, which will never be null.
-
getMatchType
Get the index match type.- Returns:
- index match type, which will never be null.
-
getMatchTypeString
Get the index match type as a string.- Returns:
- the String representation of the index match type, never null.
-
getIndexStateString
Get the index state as a string.- Returns:
- the String representation of the index state, never null.
-
getIndexState
Get the index state.- Returns:
- value of indexState.
-