Class ConfigManager
-
Nested Class Summary
Nested ClassesModifier and TypeClassDescriptionstatic enum
This is a list of config data short-hands that users can use to load that type of config data. -
Field Summary
FieldsModifier and TypeFieldDescriptionstatic final int
Page size to be used during paged search operations for configuration data. -
Constructor Summary
ConstructorsConstructorDescriptionConfigManager
(IsodeDirectorySession isodeDS) Create a config manager using the given Isode directory session. -
Method Summary
Modifier and TypeMethodDescriptioncreateLDAPChangelogEntry
(int maxEntryAge, int prunePeriod) Construct LDAPChangelogEntry entry (which will be something like "cn=changelog,cn=config").createOAuthEntry
(String serverAddress, Integer serverPort, Integer tokenPort, Integer tokenDuration, Integer refreshTokenDuration, Boolean allowNonTLSMode, Boolean useClientStrongAuth) Construct OAuthEntry entry (which will be something like "cn=oauth,cn=config").void
Delete the LDAPChangelogEntry entry.void
Delete the OAuth configuration entry.Once config entry is loaded successfully, i.e.boolean
boolean
boolean
boolean
Check whether the connected server has the same major version as this client.boolean
Check whether the connected server has the same minor version as this client.boolean
Determine if DSA is stand alone.boolean
Determine if DSA is stand alone or a failover master.void
loadConfigObject
(ConfigManager.ConfigObjectClass objectClass) Load the given type of configuration data.
-
Field Details
-
PAGE_SIZE
public static final int PAGE_SIZEPage size to be used during paged search operations for configuration data. Admin size limit was typically set to 200 historically, hence keeping the page size smaller than that. If page size is bigger than admin size limit, then each page may hit the limit.- See Also:
-
-
Constructor Details
-
ConfigManager
Create a config manager using the given Isode directory session.This sets up an internal
CommonArgs
variable based on the value in the givenIsodeDirectorySession
. This variable is then used for directory operations by the Config Manager. If further changes are done in the value in theIsodeDirectorySession
, this internal variable here would not be updated.No directory operations are performed in this constructor.
- Parameters:
isodeDS
- Isode directory session- Throws:
IncorrectVersionException
- if the version of DSA is _known_ to be incompatible.
-
-
Method Details
-
isSameMajorVersion
public boolean isSameMajorVersion()Check whether the connected server has the same major version as this client.- Returns:
- true if the connected M-Vault has the same major version as me, false otherwise.
-
isSameMinorVersion
public boolean isSameMinorVersion()Check whether the connected server has the same minor version as this client.- Returns:
- true if the connected M-Vault has the same major version as me, false otherwise.
-
getRootDSE
- Returns:
- DSAIT cache - non-null if any config in
ConfigManager.ConfigObjectClass
is loaded. Would be empty if the user does not have permissions to read the DSE data. Could be empty or incomplete if an error occurs when loading data.
-
getConfigEntry
Once config entry is loaded successfully, i.e. it is non=null, it is re-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 a null or invalid config entry.However, the first time it is loaded, the user has to ensure that it is not null before using it. It could be null if the user has no permission to read it and in this case most managerial tasks should not be done.
- Returns:
- 'cn=config' configuration entry - non-null if
ConfigManager.ConfigObjectClass.DSA_CONFIG
is loaded and the user has permissions to read the 'cn=config' object. Could remain the same as before if an error occurs when loading data.
-
getLogConfigObject
- Returns:
- logging configuration entry - non-null if
ConfigManager.ConfigObjectClass.DSA_CONFIG
is loaded and the user has permissions to read the logging configuration. Could remain the same as before if an error occurs when loading data.
-
getGdamManager
- Returns:
- GDAM manager - non-null if
ConfigManager.ConfigObjectClass.GDAM
is loaded. Would be empty if the user does not have permissions to read the GDAM data. Could be empty or incomplete if an error occurs when loading data.
-
getPeerManager
- Returns:
- peer manager - non-null if
ConfigManager.ConfigObjectClass.PEER_DSA
is loaded. Would be empty if the user does not have permissions to read the peer data. Could be empty or incomplete if an error occurs when loading data.
-
getOCSPServiceManager
- Returns:
- OCSP manager - non-null if
ConfigManager.ConfigObjectClass.GDAM
is loaded. Would be empty if the user does not have permissions to read the OCSP data. Could be empty or incomplete if an error occurs when loading data.
-
getShadowManager
- Returns:
- shadow agreement manager - non-null if
ConfigManager.ConfigObjectClass.SHADOW_AGREEMENT
is loaded. Would be empty if the user does not have permissions to read the shadow agreements. Could be empty or incomplete if an error occurs when loading data.
-
getFailoverManager
- Returns:
- Failover manager - non-null if
ConfigManager.ConfigObjectClass.FAILOVER_CONFIG
is loaded. Would contain data according to the user permissions to read failover data. Could be incomplete if an error occurs when loading data.
-
getMESHManager
- Returns:
- MESH manager - non-null if
ConfigManager.ConfigObjectClass.MESH_CONFIG
is loaded. Would contain data according to the user permissions to read MESH data. Could be incomplete if an error occurs when loading data.
-
getLDAPChangelogEntry
- Returns:
- LDAPChangelogEntry - non-null if
ConfigManager.ConfigObjectClass.LDAP_CHANGELOG
is loaded, entry is present and the user has permissions to read the 'cn=changelog,cn=config' object. Could remain the same as before if an error occurs when loading data.
-
getOAuthEntry
- Returns:
- OAuthEntry - non-null if
ConfigManager.ConfigObjectClass.OAUTH_CONFIG
is loaded, entry is present and the user has permissions to read the 'cn=oauth,cn=config' object. Could remain the same as before if an error occurs when loading data.
-
loadConfigObject
public void loadConfigObject(ConfigManager.ConfigObjectClass objectClass) throws ReadFailedException, ConfigOpFailedException Load the given type of configuration data.Perform a "best-efforts" attempt to read the requested information about the configuration. This is typically done when a new IsodeDirectorySession is bound, but may be requested at any subsequent time (e.g. to reload up-to-date data). In case of any exceptions, the stored objects for the requested type may remain the same as before or may contain incomplete data, depending on how much data has been read.
- Parameters:
objectClass
- Enum identifying the config data of interest.- Throws:
ConfigOpFailedException
- if mandatory attributes are not loadedReadFailedException
- if there is an error while reading data from the directory server
-
createLDAPChangelogEntry
public LDAPChangelogEntry createLDAPChangelogEntry(int maxEntryAge, int prunePeriod) throws ConfigOpFailedException, ReadFailedException Construct LDAPChangelogEntry entry (which will be something like "cn=changelog,cn=config"). This is used when you're enabling LDAP change logging. If logging is already enabled, this method simply returns the existing LDAPChangelogEntry entry and does not do anything else.Since there is no manager dedicated to the LDAPChangelogEntry entry, ConfigManager needs to ensure that the LDAPChangelogEntry entry value that it holds is correct and so needs to provide methods to create and delete it.
The returned result will contain the following attributes
objectClass = top, icChangeLogGdam
diskDatabaseDirectory = "changelog"
(hard-coded)changeLogMaxEntryAge = [seconds]</code
changeLogPrunePeriod = [seconds]
- Parameters:
maxEntryAge
- the value for changeLogMaxEntryAge.prunePeriod
- the value for changeLogPrunePeriod.- Returns:
- created LDAPChangelogEntry 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.
-
deleteLDAPChangelogEntry
Delete the LDAPChangelogEntry entry. If logging is already disabled,this method simply returns and does not do anything else.- Throws:
ConfigOpFailedException
- if there is an error during the delete.
-
createOAuthEntry
public OAuthEntry createOAuthEntry(String serverAddress, Integer serverPort, Integer tokenPort, Integer tokenDuration, Integer refreshTokenDuration, Boolean allowNonTLSMode, Boolean useClientStrongAuth) throws ConfigOpFailedException, ReadFailedException Construct OAuthEntry entry (which will be something like "cn=oauth,cn=config"). This is used when you're enabling OAuth services. If already enabled, this method simply returns the existing OAuthEntry entry and does not do anything else.Since there is no manager dedicated to the LDAPChangelogEntry entry, ConfigManager needs to ensure that the LDAPChangelogEntry entry value that it holds is correct and so needs to provide methods to create and delete it.
The returned result will contain the following attributes
objectClass = top, icChangeLogGdam
diskDatabaseDirectory = "changelog"
(hard-coded)changeLogMaxEntryAge = [seconds]</code
changeLogPrunePeriod = [seconds]
- Parameters:
maxEntryAge
- the value for changeLogMaxEntryAge.prunePeriod
- the value for changeLogPrunePeriod.- Returns:
- created LDAPChangelogEntry 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.
-
deleteOAuthEntry
Delete the OAuth configuration entry. No action if already deleted.- Throws:
ConfigOpFailedException
- if the delete failed for any reason.
-
isStandAlone
public boolean isStandAlone()Determine if DSA is stand alone.- Returns:
- Return true if DSA is stand alone (not part of a failover or multimaster group), false otherwise.
- Since:
- 16.3
-
isStandAloneOrMaster
public boolean isStandAloneOrMaster()Determine if DSA is stand alone or a failover master.- Returns:
- Return true if DSA is stand alone or a master of a failover group, false otherwise.
- Since:
- 16.3
-
isFailoverMirror
public boolean isFailoverMirror()- Returns:
- true if DSA is a failover mirror (and not the master).
- Since:
- 16.3
-
isFailoverMaster
public boolean isFailoverMaster()- Returns:
- true if DSA is a failover mirror and the master.
- Since:
- 16.3
-
isMultimaster
public boolean isMultimaster()- Returns:
- true if DSA has a multimaster configuration.
- Since:
- 19.0v25
-