Class MESHManager

java.lang.Object
com.isode.dsapi.config.MESHManager

public class MESHManager extends Object
Manages MESH (multimaster) related configuration.
Since:
16.3
Author:
dsm
  • Constructor Details

    • MESHManager

      public MESHManager(IsodeDirectorySession ds)
      MESHManager constructor.
      Parameters:
      ds - Isode directory session
  • Method Details

    • load

      public void load(Entry entry) throws ConfigOpFailedException, ReadFailedException
      Load failover entry & associated data.
      Parameters:
      entry - Entry.
      Throws:
      ConfigOpFailedException - if mandatory attributes are not loaded
      ReadFailedException - if there is an error while reading data from the directory server
    • createMESHEntry

      public MESHEntry createMESHEntry(String desc, List<IdentifiedDN> servers, List<IdentifiedDN> agreements) throws ConfigOpFailedException, ReadFailedException
      Construct MESH entry (always named "cn=mesh,cn=config"). Used when creating the MESH configuration.
      Parameters:
      desc - String describing the MESH group, does not have to be unique but helps user friendliness.
      servers - Map of integer server IDs to server DNs. If null then only _this_ server is added, and with a server ID of 1 (0 is not permitted).
      agreements - Map of integer server IDs to GDAM DNs, which constitutes the set of failover agreements. Must not be null.
      Returns:
      Created MESH entry, will never be null.
      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.
    • deleteMESHEntry

      public void deleteMESHEntry() throws ConfigOpFailedException
      Delete the MESH configuration entry.
      Throws:
      ConfigOpFailedException - if there is an error during the delete.
    • addServer

      public void addServer(int dsaID, DN dsaDN) throws ConfigOpFailedException, ReadFailedException
      Add a DSA to the MESH group. This method does directory operations so a user may want to call it in the background.
      Parameters:
      dsaID - Integer identifier to be associated with the new DN.
      dsaDN - DN of failover DSA to add, must not be null
      Throws:
      ReadFailedException - if there is a problem on reading the committed entry back
      ConfigOpFailedException - if MESH entry is null (possibly because there are not enough access rights to read it) or there is any other problem on applying the changes.
    • removeServer

      public void removeServer(int id) throws ConfigOpFailedException, ReadFailedException
      Remove a server from the group.
      Parameters:
      id - Integer of the ID DSA being removed. Must not be null.
      Throws:
      ReadFailedException - if there is a problem on reading the committed entry back
      ConfigOpFailedException - if MESH entry is null (possibly because there are not enough access rights to read it) or there is any other problem on applying the changes.
    • loaded

      public boolean loaded()
      Check the MESH configuration entry has been loaded successfully.
      Returns:
      'true' if loaded OK, 'false' otherwise.
    • getServerMap

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

      public DN getServerDN(Integer dsaID)
      Return the DN of an identified server.
      Parameters:
      dsaID - Server identifier.
      Returns:
      DN of server, null on unrecognized ID.
    • getAgreementMap

      public Map<Integer,DN> getAgreementMap()
      Returns:
      map of agreement IDs to GDAM DN. Will never be null.
    • getAgreementDN

      public DN getAgreementDN(Integer agmtID)
      Return the DN of an identified server.
      Parameters:
      agmtID - Agreement ID.
      Returns:
      DN of agreement (GDAM), null on unrecognized ID.
    • getGroupID

      public String getGroupID()
      Returns:
      The MESH group configuration ID.
    • getDescription

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

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

      public int getOwningServerID()
      Returns:
      ID of server from which this configuration was loaded.
    • 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.