Class ConfigUtil

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

public class ConfigUtil extends Object
Utility methods.
Since:
15.0
Author:
mv
  • Field Details

    • CONFIG_READ_STR

      public static final String CONFIG_READ_STR
      String that can be used in messages to indicate that config entry was not read from the directory.
      See Also:
    • CANT_PROCEED_STR

      public static final String CANT_PROCEED_STR
      String that can be used in messages to indicate that we can not proceed with the given action.
      See Also:
    • FAILOVER_DISP

      public static final PeerAuthData FAILOVER_DISP
      DISP PeerAuthData for a failover DSA; authmode: Name-only both ways
    • FAILOVER_DSP

      public static final PeerAuthData FAILOVER_DSP
      DSP PeerAuthData for a failover DSA; authmode: none (anonymous) both ways
  • Constructor Details

    • ConfigUtil

      public ConfigUtil()
  • Method Details

    • createFailoverConfig

      public static void createFailoverConfig(IsodeDirectorySession masterDS, DN groupDN) throws ConfigOpFailedException, ReadFailedException
      Create an initial failover configuration on the master and create a peer entry for the master DSA on itself. This method also updates the FailoverGroups with this information. This method does directory operations so a user may want to call it in the background. The config manager of the master DS should have been loaded with ConfigManager.ConfigObjectClass.DSA_CONFIG , ConfigManager.ConfigObjectClass.FAILOVER_CONFIG and ConfigManager.ConfigObjectClass.PEER_DSA.
      Parameters:
      masterDS - Isode directory session of the master DS, must not be null
      groupDN - the DN of the failover group. Must not be null.
      Throws:
      ReadFailedException - if there is a problem on reading the committed entries back
      ConfigOpFailedException - if there is any other problem on applying the changes
    • addMirror

      public static void addMirror(IsodeDirectorySession masterDS, DN dsaDN, PresentationAddress pa) throws ConfigOpFailedException, ReadFailedException
      Add a DSA to the failover group of the master and create a peer entry for the failover DSA in the master. This method does directory operations so a user may want to call it in the background. The config manager of the master DS should have been loaded with ConfigManager.ConfigObjectClass.FAILOVER_CONFIG and ConfigManager.ConfigObjectClass.PEER_DSA.
      Parameters:
      masterDS - Isode directory session of the master DS, must not be null
      dsaDN - DN of failover DSA to add, must not be null
      pa - Presentation address of failover DSA to add, must not be null
      Throws:
      ReadFailedException - if there is a problem on reading the committed entries back
      ConfigOpFailedException - if there is any other problem on applying the changes
    • computeReverseAuthData

      public static PeerAuthData computeReverseAuthData(PeerEntry peerEntryforThisDsaOnThePeer, PeerEntry peerEntryForPeerOnThisDsa, Protocol protocol, boolean isDiagnol)
      Compute the reverse authentication data for a peer entry using the authentication data of the given directory server
      Parameters:
      peerEntryforThisDsaOnThePeer - peer entry representing this DSA on the peer directory server, can be null in which case reverse auth data will be computed using the peerEntryForPeerOnThisDsa and not be influenced by the data on the peer
      peerEntryForPeerOnThisDsa - peer entry representing peer DSA on this directory server, must not be null
      protocol - DISP or DSP
      isDiagnol - true if the peer auth data is to be computed without taking into consideration the already existing peer auth data on the peer
      Returns:
      computed reverse authentication data, will not be null
    • getAllowedModes

      public static List<PeerAuthMode> getAllowedModes(Protocol protocol)
      Get the modes that are allowed for a given protocol
      Parameters:
      protocol - protocol (DISP or DSP)
      Returns:
      list of modes allowed
    • getConnectionPolicys

      public static List<ConnectionPolicy> getConnectionPolicys()
      Get the connection policies that are allowed for Shadowing and Chaining Operation
      Returns:
      list of connection policies.
    • getManageDSEType

      public static DSEType getManageDSEType(IsodeDirectorySession ds, DN dn) throws ConfigOpFailedException
      Perform a synchronous read of a specific directory entry and obtain its DSEType using config manager common args. DSEType obtained can be different depending on whether manageDSAIt is set or not. Config manager common args have it set.
      Parameters:
      ds - Isode directory session of the DS to read entry from. Must not be null
      dn - DN of the entry to read. Must not be null.
      Returns:
      DSEType of the entry read from the directory. If config manager is null, it returns null.
      Throws:
      ConfigOpFailedException - if there is any problem on reading the entry or attribute
    • createMESHConfig

      public static void createMESHConfig(IsodeDirectorySession ds, NetworkAddress meshNA, String description) throws ConfigOpFailedException, ReadFailedException
      Create a MESH configuration. The actual steps are:
      1. Create a new MESH configuration entry, where the list of servers contains only this server and the list of agreements covers all GDAMs.
      2. Update the server presentation address in cn=core,cn=config to include the MESH component.
      3. Enable MESH by setting isodeMESHEnabled in cn=core,cn=config.
      This method does directory operations so a user may want to call it in the background.
      Parameters:
      ds - Directory session of the target DSA, mustn't be null.
      meshNA - Optional MESH address to add to DSA address.
      description - Description to add to MESH configuration entry.
      Throws:
      ReadFailedException - If there is a problem on reading the committed entries back.
      ConfigOpFailedException - if there is any other problem on applying the changes.