Class IndexEntry

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

public class IndexEntry extends ManagedObject
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
  • 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 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

      public String getName()
      Get the index name (value of 'cn').
      Returns:
      Index name, which will never be null.
    • getAttrType

      public AttributeType getAttrType()
      Get the indexed attribute type.
      Returns:
      indexed attribute type, which will never be null.
    • getAttrTypeString

      public String getAttrTypeString()
      Get the indexed attribute type name.
      Returns:
      indexed attribute type name, which will never be null.
    • getMatchType

      public IndexEntry.IndexMatchType getMatchType()
      Get the index match type.
      Returns:
      index match type, which will never be null.
    • getMatchTypeString

      public String getMatchTypeString()
      Get the index match type as a string.
      Returns:
      the String representation of the index match type, never null.
    • getIndexStateString

      public String getIndexStateString()
      Get the index state as a string.
      Returns:
      the String representation of the index state, never null.
    • getIndexState

      public IndexEntry.IndexState getIndexState()
      Get the index state.
      Returns:
      value of indexState.