Class MESHEntry

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

public class MESHEntry extends ManagedObject
MESH (multimaster) configuration entry representation.
Since:
16.3
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 MESHEntry create(IsodeDirectorySession ds, String desc, List<IdentifiedDN> servers, List<IdentifiedDN> agreements) throws ConfigOpFailedException, ReadFailedException
      Construct MESHEntry (which will be something like "cn=mesh,cn=config"). This is used for initial setup of a multimaster configuration.
      Parameters:
      ds - Directory session. Must not be null.
      desc - String describing the MESH group, does not have to be unique but helps user friendliness. Must not be null.
      servers - List of ID/DN pairs indicating the set of peer DSAs. Must not be null.
      agreements - List of ID/DN pairs indicating the set of agreements. Must not be null.
      Returns:
      Created MESH configuration 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.
    • loadMonitorEntries

      public void loadMonitorEntries() throws ReadFailedException, ConfigOpFailedException
      Read any monitor entries (subordinate to 'cn=mesh,cn=config'.
      Throws:
      ConfigOpFailedException - If mandatory attributes are not loaded.
      ReadFailedException - If there is an error while reading data from the directory server.
    • getGroupID

      public String getGroupID()
      Returns:
      ID (string) of the MESH group. Never null.
    • getDescription

      public String getDescription()
      Returns:
      The description of the MESH configuration. Never null.
    • getOwningServerDN

      public DN getOwningServerDN()
      Returns:
      DN of server from which this configuration was loaded. Never null.
    • getOwningServerID

      public int getOwningServerID()
      Returns:
      ID of server from which this configuration was loaded.
    • getServerDN

      public DN getServerDN(int id)
      Returns:
      DN of server with given ID. Never null.
    • addServer

      public void addServer(int id, DN dsaDN)
      Add a DSA to the MESH group.
      Parameters:
      id - Unique ID of server to add.
      dsaDN - DN of DSA to add. Must not be null.
    • removeServer

      public void removeServer(int id)
      Remove a DSA from the MESH group
      Parameters:
      id - Server ID.
    • getServerMap

      public Map<Integer,DN> getServerMap()
      Get set of configured servers.
      Returns:
      List of IdentifiedDNs forming the MESH group. Will never be null.
    • getAgreementMap

      public TreeMap<Integer,DN> getAgreementMap()
      Get set of configured agreements.
      Returns:
      map of agreement IDs to GDAM DN. Will never be null.
    • getAgreementState

      public MESHAgreementReport getAgreementState(Integer id)
      Get state associated with an agreement.
      Returns:
      State object associated with the given agreement ID, null if not found.
    • getServerState

      public MESHServerReport getServerState(Integer id)
      Get (connection) state associated with a server.
      Returns:
      State object associated with the given server ID, null if not found.