Package com.isode.dsapi.config
Class FailoverEntry
java.lang.Object
com.isode.dsapi.config.ManagedObject
com.isode.dsapi.config.FailoverEntry
Failover entry stored in the directory session.
- Since:
- 15.0
- Author:
- dsm
-
Field Summary
Fields inherited from class com.isode.dsapi.config.ManagedObject
logger
-
Constructor Summary
ConstructorsConstructorDescriptionFailoverEntry
(Entry entry, IsodeDirectorySession ds) Construct from the entry object. -
Method Summary
Modifier and TypeMethodDescriptionvoid
Add a DSA to the failover group.static FailoverEntry
create
(IsodeDirectorySession ds, DN dsaDN, DN groupDN) Construct Failover entry (which will be something like "cn=failover,cn=config").getGdamDN
(int id) Get a GDAM DN given an integer ID.void
Load values from an entry.void
removeMirror
(DN dsaDN) Remove a DSA from the failover groupvoid
setIdentityDN
(DN newIdDN) Set failover identity DNMethods 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
-
FailoverEntry
Construct from the entry object.- Parameters:
entry
- Entry representing the failover 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 FailoverEntry create(IsodeDirectorySession ds, DN dsaDN, DN groupDN) throws ConfigOpFailedException, ReadFailedException Construct Failover entry (which will be something like "cn=failover,cn=config"). This is used when you're turning a non-failover DSA into the master of a new failover group.The returned result will contain the following attributes
objectClass = top, isodeFailoverConfiguration
isodeFailoverIdentity = groupDN</code
isodeFailoverGroup = dsaDN
(multi-valued attribute with only one member)
- Parameters:
ds
- Directory session.dsaDN
- the DN of the DSA which is going to be the initial member of the group. Must not be null.groupDN
- the DN of the failover group (which can be the same as newMasterDSADN but doesn't have to be). Must not be null.- Returns:
- created failover 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.
-
getIdentityDN
- Returns:
- failover identity DN, i.e. the DN used to bind to regular consumer DSAs, will never be null
-
setIdentityDN
Set failover identity DN- Parameters:
newIdDN
- failover identity DN, must not be null
-
getGdamDN
Get a GDAM DN given an integer ID.- Parameters:
id
- GDAM/agreement ID.- Returns:
- GDAM DN or null if no mapping found.
-
addMirror
Add a DSA to the failover group.- Parameters:
dsaDN
- DN of DSA to add, must not be null
-
removeMirror
Remove a DSA from the failover group- Parameters:
dsaDN
- DN of DSA to remove, must not be null.
-
getFailoverGroupList
- Returns:
- list of DNs forming the failover group. Can be empty but will never be null.
-
getGdamMap
- Returns:
- map of agreement/GDAM IDs to GDAM DN. Will never be null.
-