Package com.isode.dsapi.config
Class ShadowAgreement
java.lang.Object
com.isode.dsapi.config.ManagedObject
com.isode.dsapi.config.ShadowAgreement
- Direct Known Subclasses:
ConsumerAgreement
,SupplierAgreement
Shadow agreement object.
- Since:
- 15.0
- Author:
- dsm
-
Nested Class Summary
Nested ClassesModifier and TypeClassDescriptionstatic enum
The codes here correspond to those defined in apps/d3/shadow/ShadowError.h Note: Probably this should be generated automatically but it's not clear how to make swig generate enum types. -
Field Summary
FieldsModifier and TypeFieldDescriptionprotected Integer
protected Integer
protected String
protected Boolean
protected Boolean
protected Integer
protected Date
protected Date
protected Date
protected Boolean
protected DN
protected DN
protected Boolean
protected Integer
protected Integer
Fields inherited from class com.isode.dsapi.config.ManagedObject
logger
-
Constructor Summary
ConstructorsConstructorDescriptionShadowAgreement
(Entry agreement, Entry state, IsodeDirectorySession ds) Construct from the entry object. -
Method Summary
Modifier and TypeMethodDescriptionBuild agreement and state DN.protected static MapEntry
Create a basic agreement entry and update DB.void
forceUpdate
(String timeStr, boolean total) Force an update.Get the agreement ID.Get the agreement version.Get begin time.Get the enabled flag.static String
Get a GeneralizedTime string used to represent 'now' when forcing shadow updates.If on change agreement.Get the other times flag.getPeer()
Get the peer DSA DN.Return a ShadowError enum corresponding to the last reported error for this agreement.Get the shadow prefix.If supplier initiated.Get periodic update interval.Get periodic update window size.Last error, 0 indicates no error.Last error as a string.Last error time, if there is one,Last success time, if there is one.Last update time, if there is one.protected void
loadAgreement
(Entry entry) Reload cached values.void
Reload cached state values.void
setAgreementVersion
(Integer version) Set the agreement version.void
setBeginTime
(String beginTime) Set periodic begin time.void
setEnabled
(Boolean enabled) Set the enabled flag.void
setOnChange
(Boolean onChangeFlag) Set agreement as 'on change'.void
setOtherTimes
(Boolean otherTimes) Set the other times flag.void
setSupplierInitiated
(Boolean suppInited) Set supplier initiated flag.void
setUpdateInterval
(Integer interval) Set periodic update interval.void
setWindowSize
(Integer size) Set periodic update window size.toString()
Methods 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, load, remove, removeAttr, removeStringValue, reset, reset, updateAttr, updateAttr, updateAttr, updateBoolean, updateDN, updateInteger, updateMultiValuedBER, updateMultiValuedInteger, updateMultiValuedString, updatePA, updatePA, updateString
-
Field Details
-
lastSuccessTime
-
lastUpdateTime
-
lastErrorTime
-
lastError
-
peerDsaDN
-
agreementId
-
agreementVersion
-
isEnabled
-
prefixDN
-
onChange
-
supplierInitiated
-
beginTimeStr
-
updateInterval
-
isOtherTimes
-
windowSize
-
-
Constructor Details
-
ShadowAgreement
Construct from the entry object.- Parameters:
agreement
- Entry representing the agreement, must not be nullstate
- Entry representing the state, can be null if state entry is not readds
- Isode directory session, must not be null
-
-
Method Details
-
loadAgreement
Reload cached values.- Parameters:
entry
- Entry representing the agreement, could be null if the existing entry has to be reloaded.- Throws:
ConfigOpFailedException
- if mandatory attributes are not loaded
-
loadState
Reload cached state values.- Parameters:
state
- Entry representing the state, can be null if state entry is not read
-
buildDN
Build agreement and state DN.- Parameters:
dsaDN
- DSA DN.id
- Agreement ID.- Returns:
- List containing agreement (index 0) and state DN (index 1)
-
create
protected static MapEntry create(DN entryDN, DN dsaDN, Integer id, Integer version, DN prefixDN, Boolean enabled) Create a basic agreement entry and update DB.- Parameters:
entryDN
- DN of the agreement.dsaDN
- DSA DN.id
- Agreement ID.version
- Agreement version.prefixDN
- Prefix DN.enabled
- Enabled flag.- Returns:
- map entry object containing added attributes.
-
lastSuccessTime
Last success time, if there is one.- Returns:
- Last success time, which may be null if none is recorded.
-
lastUpdateTime
Last update time, if there is one.- Returns:
- Last update time, which may be null if none is recorded.
-
lastErrorTime
Last error time, if there is one,- Returns:
- Last error time, which may be null if none is recorded.
-
lastError
Last error, 0 indicates no error.- Returns:
- Last error
-
getShadowError
Return a ShadowError enum corresponding to the last reported error for this agreement.- Returns:
- a ShadowError enum which will never be null.
- Since:
- 15.1
-
lastErrorString
Last error as a string. For error code values see apps/d3/shadow/ShadowError.h.- Returns:
- a String representation of the last error, which will never be null (but may be "no error").
-
getForceNowTime
Get a GeneralizedTime string used to represent 'now' when forcing shadow updates.- Returns:
- generalised time string for now
-
forceUpdate
public void forceUpdate(String timeStr, boolean total) throws BadValueException, NoSuchEntryException, ReferralException, BadSyntaxException, DirectoryOperationFailedException, IndicationException, NotBoundException, NotImplementedException, BadAttributeTypeException, SignedOpFailedException, ConfigOpFailedException Force an update.- Parameters:
timeStr
- Time of update, if null, current time would be used- Throws:
BadValueException
- if timeStr has invalid formatSignedOpFailedException
BadAttributeTypeException
NotImplementedException
NotBoundException
IndicationException
DirectoryOperationFailedException
BadSyntaxException
ReferralException
NoSuchEntryException
ConfigOpFailedException
- if anything goes wrong and the update is not done- See Also:
-
getPeer
Get the peer DSA DN.- Returns:
- Peer DSA DN, will never be null
-
getAgreementID
Get the agreement ID.- Returns:
- Agreement ID
-
getAgreementVersion
Get the agreement version.- Returns:
- Agreement version
-
setAgreementVersion
Set the agreement version.- Parameters:
version
- Agreement version, null to clear the value altogether
-
getEnabled
Get the enabled flag.- Returns:
- Enabled flag
-
setEnabled
Set the enabled flag.- Parameters:
enabled
- Enabled flag, null to clean the attribute
-
getShadowPrefix
Get the shadow prefix.- Returns:
- Shadow prefix DN, will not be null
-
getOnChange
If on change agreement.- Returns:
- On Change agreement flag
-
setOnChange
Set agreement as 'on change'.- Parameters:
onChangeFlag
- On Change agreement flag, null to clear the attribute
-
getSupplierInitiated
If supplier initiated.- Returns:
- Supplier initiated flag
-
setSupplierInitiated
Set supplier initiated flag.- Parameters:
suppInited
- Supplier initiated flag, null to clear
-
getBeginTime
Get begin time.- Returns:
- Begin time string
-
setBeginTime
Set periodic begin time.- Parameters:
beginTime
- Begin time string
-
getUpdateInterval
Get periodic update interval.- Returns:
- Update interval
-
setUpdateInterval
Set periodic update interval. If the value set is null, the attribute is deleted.- Parameters:
interval
- Update interval, null to clear the value
-
getOtherTimes
Get the other times flag.- Returns:
- Other times flag
-
setOtherTimes
Set the other times flag.- Parameters:
otherTimes
- Other times flag, null to clear
-
getWindowSize
Get periodic update window size.- Returns:
- Update window size.
-
setWindowSize
Set periodic update window size.- Parameters:
size
- Update window size, null to delete the attribute
-
toString
-