Package com.isode.dsapi.config
Class MESHEntry
java.lang.Object
com.isode.dsapi.config.ManagedObject
com.isode.dsapi.config.MESHEntry
MESH (multimaster) configuration entry representation.
- Since:
- 16.3
- Author:
- dsm
-
Field Summary
Fields inherited from class com.isode.dsapi.config.ManagedObject
logger
-
Constructor Summary
ConstructorsConstructorDescriptionMESHEntry
(Entry entry, IsodeDirectorySession ds) Construct from the entry object. -
Method Summary
Modifier and TypeMethodDescriptionvoid
Add a DSA to the MESH group.static MESHEntry
create
(IsodeDirectorySession ds, String desc, List<IdentifiedDN> servers, List<IdentifiedDN> agreements) Construct MESHEntry (which will be something like "cn=mesh,cn=config").Get set of configured agreements.Get state associated with an agreement.int
getServerDN
(int id) Get set of configured servers.Get (connection) state associated with a server.void
Load values from an entry.void
Read any monitor entries (subordinate to 'cn=mesh,cn=config'.void
removeServer
(int id) Remove a DSA from the MESH groupMethods inherited from class com.isode.dsapi.config.ManagedObject
addAttribute, addAttribute, addAttribute, addAttributeValue, addAttributeValue, addEntry, addOC, checkMandatory, checkMandatory, checkMandatory, checkMandatory, commit, commitNoRefresh, createAP, createAttributeType, createDN, createPA, createRDN, createRDN, getAttribute, getAttributeDefaultWhenNull, getDN, getIsodeDirectorySession, getMultiValueBer, getMultiValuedInteger, getMultiValuedInteger, getMultiValuedString, getMultiValuedString, getPA, getValue, getValueAttrTypeFromOID, getValueBer, getValueBoolean, getValueDate, getValueDate, getValueDN, getValueInteger, getValueInteger, getValueString, getValueString, getValueStringFromAttribute, hasAttributeChanged, hasChanges, remove, removeAttr, removeStringValue, reset, reset, updateAttr, updateAttr, updateAttr, updateBoolean, updateDN, updateInteger, updateMultiValuedBER, updateMultiValuedInteger, updateMultiValuedString, updatePA, updatePA, updateString
-
Constructor Details
-
MESHEntry
Construct from the entry object.- Parameters:
entry
- Entry representing the MESH config.ds
- Isode directory session- Throws:
ConfigOpFailedException
- if mandatory attributes are not loaded
-
-
Method Details
-
load
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 classManagedObject
- 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
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
- Returns:
- ID (string) of the MESH group. Never null.
-
getDescription
- Returns:
- The description of the MESH configuration. Never null.
-
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
- Returns:
- DN of server with given ID. Never null.
-
addServer
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
Get set of configured servers.- Returns:
- List of IdentifiedDNs forming the MESH group. Will never be null.
-
getAgreementMap
Get set of configured agreements.- Returns:
- map of agreement IDs to GDAM DN. Will never be null.
-
getAgreementState
Get state associated with an agreement.- Returns:
- State object associated with the given agreement ID, null if not found.
-
getServerState
Get (connection) state associated with a server.- Returns:
- State object associated with the given server ID, null if not found.
-