Class GDAMEntry

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

public class GDAMEntry extends ManagedObject
GDAMEntry represents a GDAM database entry.
Since:
15.0
  • 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 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

      public void loadIndexes() throws ReadFailedException, ConfigOpFailedException
      Loads the indexes for this GDAM entry from the DB.
      Throws:
      ConfigOpFailedException - if mandatory attributes are not loaded
      ReadFailedException - if there is an error while reading data from the directory server
    • createIndex

      Create a new index and update DB.
      Parameters:
      at - attribute type
      matchType - 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

      public boolean deleteIndex(String name) throws ConfigOpFailedException
      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

      public HashMap<String,IndexEntry> getIndexes()
      Get the hash map of indexes.
      Returns:
      hash map of indexes
    • getName

      public String getName()
      Get the GDAM name (value of 'cn').
      Returns:
      GDAM name
    • getGDAMType

      public GDAMType getGDAMType()
      Get the GDAM type (bagdam, imgdam, etc). This can't be changed.
      Returns:
      GDAMType
    • getMaxLoadThreads

      public Integer getMaxLoadThreads()
      Returns:
      Maximum number of threads used to load data at startup (IMGDAM)
    • getMaxEntriesPerFile

      public Integer getMaxEntriesPerFile()
      Returns:
      Maximum number of entries written to each snapshot'ed LDIF file (IMGDAM)
    • getCheckpointSchedule

      public List<String> getCheckpointSchedule()
      Returns:
      Schedule of times to perform checkpoint (expressed in seconds past midnight local time) (IMGDAM)
    • getCheckpointInterval

      public Integer getCheckpointInterval()
      Returns:
      Desired interval between checkpoints in seconds, which overrides isodeCheckpointSchedule if specified (IMGDAM)
    • setMaxLoadThreads

      public void setMaxLoadThreads(Integer value)
      Set the maximum number of threads used to load data at startup (IMGDAM)
      Parameters:
      value - Value to set. If null, attribute is deleted.
    • setMaxEntriesPerFile

      public void setMaxEntriesPerFile(Integer value)
      Set the maximum number of entries written to each snapshotted LDIF file (IMGDAM)
      Parameters:
      value - Value to set. If null, attribute is deleted.
    • setCheckpointSchedule

      public void setCheckpointSchedule(List<String> list) throws BadValueException
      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

      public void setCheckpointInterval(Integer value)
      Set the desired interval between checkpoints, which overrides isodeCheckpointSchedule if specified (IMGDAM)
      Parameters:
      value - Value to set. If null, attribute is deleted.
    • getBuildIndex

      public Boolean 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

      public void setBuildIndex(Boolean value)
      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 a ManagedObject.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

      public String toString()
      Overrides:
      toString in class Object
    • validateName

      public static void validateName(String gdamName) throws ConfigOpFailedException
      Validates given GDAM name.
      Parameters:
      gdamName - GDAM name
      Throws:
      ConfigOpFailedException - in case name is invalid