Package com.isode.dsapi.config
Class ConfigUtil
java.lang.Object
com.isode.dsapi.config.ConfigUtil
Utility methods.
- Since:
- 15.0
- Author:
- mv
-
Field Summary
FieldsModifier and TypeFieldDescriptionstatic final String
String that can be used in messages to indicate that we can not proceed with the given action.static final String
String that can be used in messages to indicate that config entry was not read from the directory.static final PeerAuthData
DISP PeerAuthData for a failover DSA; authmode: Name-only both waysstatic final PeerAuthData
DSP PeerAuthData for a failover DSA; authmode: none (anonymous) both ways -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionstatic void
addMirror
(IsodeDirectorySession masterDS, DN dsaDN, PresentationAddress pa) Add a DSA to the failover group of the master and create a peer entry for the failover DSA in the master.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 serverstatic void
createFailoverConfig
(IsodeDirectorySession masterDS, DN groupDN) Create an initial failover configuration on the master and create a peer entry for the master DSA on itself.static void
createMESHConfig
(IsodeDirectorySession ds, NetworkAddress meshNA, String description) Create a MESH configuration.static List<PeerAuthMode>
getAllowedModes
(Protocol protocol) Get the modes that are allowed for a given protocolstatic List<ConnectionPolicy>
Get the connection policies that are allowed for Shadowing and Chaining Operationstatic DSEType
getManageDSEType
(IsodeDirectorySession ds, DN dn) Perform a synchronous read of a specific directory entry and obtain its DSEType using config manager common args.
-
Field Details
-
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
String that can be used in messages to indicate that we can not proceed with the given action.- See Also:
-
FAILOVER_DISP
DISP PeerAuthData for a failover DSA; authmode: Name-only both ways -
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 withConfigManager.ConfigObjectClass.DSA_CONFIG
,ConfigManager.ConfigObjectClass.FAILOVER_CONFIG
andConfigManager.ConfigObjectClass.PEER_DSA
.- Parameters:
masterDS
- Isode directory session of the master DS, must not be nullgroupDN
- the DN of the failover group. Must not be null.- Throws:
ReadFailedException
- if there is a problem on reading the committed entries backConfigOpFailedException
- 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 withConfigManager.ConfigObjectClass.FAILOVER_CONFIG
andConfigManager.ConfigObjectClass.PEER_DSA
.- Parameters:
masterDS
- Isode directory session of the master DS, must not be nulldsaDN
- DN of failover DSA to add, must not be nullpa
- Presentation address of failover DSA to add, must not be null- Throws:
ReadFailedException
- if there is a problem on reading the committed entries backConfigOpFailedException
- 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 peerpeerEntryForPeerOnThisDsa
- peer entry representing peer DSA on this directory server, must not be nullprotocol
- DISP or DSPisDiagnol
- 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
Get the modes that are allowed for a given protocol- Parameters:
protocol
- protocol (DISP or DSP)- Returns:
- list of modes allowed
-
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 nulldn
- 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:- Create a new MESH configuration entry, where the list of servers contains only this server and the list of agreements covers all GDAMs.
- Update the server presentation address in cn=core,cn=config to include the MESH component.
- Enable MESH by setting isodeMESHEnabled in cn=core,cn=config.
- 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.
-