Class FailoverEntry

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

public class FailoverEntry extends ManagedObject
Failover entry stored in the directory session.
Since:
15.0
Author:
dsm
  • 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 FailoverEntry create(IsodeDirectorySession ds, DN dsaDN, DN groupDN) throws ConfigOpFailedException, ReadFailedException
      Construct Failover entry (which will be something like "cn=failover,cn=config"). This is used when you're turning a non-failover DSA into the master of a new failover group.

      The returned result will contain the following attributes

      • objectClass = top, isodeFailoverConfiguration
      • isodeFailoverIdentity = groupDN</code
      • isodeFailoverGroup = dsaDN (multi-valued attribute with only one member)
      Parameters:
      ds - Directory session.
      dsaDN - the DN of the DSA which is going to be the initial member of the group. Must not be null.
      groupDN - the DN of the failover group (which can be the same as newMasterDSADN but doesn't have to be). Must not be null.
      Returns:
      created failover 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.
    • getIdentityDN

      public DN getIdentityDN()
      Returns:
      failover identity DN, i.e. the DN used to bind to regular consumer DSAs, will never be null
    • setIdentityDN

      public void setIdentityDN(DN newIdDN)
      Set failover identity DN
      Parameters:
      newIdDN - failover identity DN, must not be null
    • getGdamDN

      public DN getGdamDN(int id)
      Get a GDAM DN given an integer ID.
      Parameters:
      id - GDAM/agreement ID.
      Returns:
      GDAM DN or null if no mapping found.
    • addMirror

      public void addMirror(DN dsaDN)
      Add a DSA to the failover group.
      Parameters:
      dsaDN - DN of DSA to add, must not be null
    • removeMirror

      public void removeMirror(DN dsaDN)
      Remove a DSA from the failover group
      Parameters:
      dsaDN - DN of DSA to remove, must not be null.
    • getFailoverGroupList

      public List<DN> getFailoverGroupList()
      Returns:
      list of DNs forming the failover group. Can be empty but will never be null.
    • getGdamMap

      public TreeMap<Integer,DN> getGdamMap()
      Returns:
      map of agreement/GDAM IDs to GDAM DN. Will never be null.