Package com.isode.dsapi.config
Class ShadowManager
java.lang.Object
com.isode.dsapi.config.ShadowManager
Shadow agreement manager manages the various entries stored in the directory
session.
- Since:
- 15.0
- Author:
- mv
-
Constructor Summary
ConstructorsConstructorDescriptionConstructor for shadow agreement manager. -
Method Summary
Modifier and TypeMethodDescriptionCreate a basic on change supplier agreement.create(DN dsaDN, Integer id, Integer version, DN prefixDN, Boolean enabled, DN subtreeDN, Boolean isSuppMaster) Create a basic on change consumer agreement.booleandeleteConsumer(DN dsaDN, DN prefixDN) Remove a consumer agreement based on the given parameters.booleandeleteSupplier(DN dsaDN, DN prefixDN) Remove a supplier agreement based on the given parameters.getAgreement(DN dsaDN, int agreementId) Find an agreement for the given agreement id and DSA DN.Get the set of consumer agreements.getConsumer(DN dsaDN, DN prefixDN) Find a consumer agreement.Get the set of supplier agreements.getSupplier(DN dsaDN, DN prefixDN) Find a supplier agreement.voidLoad a shadow agreement object.intnewAgreementID(DN peerDN, int startID) Find a free shadow agreement identifier from all the agreements for the peer.
-
Constructor Details
-
ShadowManager
Constructor for shadow agreement manager.- Parameters:
ds- Isode directory session
-
-
Method Details
-
load
public void load(Entry entry, boolean isSupplier) throws ConfigOpFailedException, ReadFailedException Load a shadow agreement object.- Parameters:
entry- Entry.isSupplier- TRUE if supplier, FALSE if consumer- Throws:
ConfigOpFailedException- if mandatory attributes are not loadedReadFailedException- if there is an error while reading data from the directory server
-
create
public ConsumerAgreement create(DN dsaDN, Integer id, Integer version, DN prefixDN, Boolean enabled, DN subtreeDN, Boolean isSuppMaster) throws ConfigOpFailedException, ReadFailedException Create a basic on change consumer agreement.- Parameters:
dsaDN- DSA DN.id- Agreement ID.version- Agreement version.prefixDN- Prefix DN.enabled- Enabled flag.subtreeDN- Subtree reference.isSuppMaster- Supplier is master flag.- Returns:
- The created consumer agreement.
- Throws:
ReadFailedException- if there is a problem on reading the committed entry back.ConfigOpFailedException- if there is any other problem on applying the changes or loading the data.
-
create
public SupplierAgreement create(DN dsaDN, Integer id, Integer version, DN prefixDN, Boolean enabled) throws ConfigOpFailedException, ReadFailedException Create a basic on change supplier agreement.- Parameters:
dsaDN- DSA DN.id- Agreement ID.version- Agreement version.prefixDN- Prefix DN.enabled- Agreement enabled flag.- Returns:
- The created supplier agreement.
- Throws:
ReadFailedException- if there is a problem on reading the committed entry back.ConfigOpFailedException- if there is any other problem on applying the changes or loading the data.
-
deleteConsumer
Remove a consumer agreement based on the given parameters.- Parameters:
dsaDN- DSA DNprefixDN- Prefix DN- Returns:
- TRUE if the consumer agreement corresponding to the given parameters was found, FALSE otherwise
- Throws:
ConfigOpFailedException- if the operation failed.
-
deleteSupplier
Remove a supplier agreement based on the given parameters.- Parameters:
dsaDN- DSA DNprefixDN- Prefix DN- Returns:
- TRUE if the supplier agreement corresponding to the given parameters was found, FALSE otherwise
- Throws:
ConfigOpFailedException- if the operation failed.
-
getSupplier
Get the set of supplier agreements.- Returns:
- list of supplier agreements
-
getConsumer
Get the set of consumer agreements.- Returns:
- list of consumer agreements
-
getConsumer
Find a consumer agreement.- Parameters:
dsaDN- DSA DNprefixDN- Prefix DN- Returns:
- consumer agreement found or null if not found
-
getSupplier
Find a supplier agreement.- Parameters:
dsaDN- DSA DNprefixDN- Prefix DN- Returns:
- supplier agreement found or null if not found
-
getAgreement
Find an agreement for the given agreement id and DSA DN.- Parameters:
dsaDN- DSA DNagreementId- Agreement ID- Returns:
- supplier agreement found or null if not found
-
newAgreementID
Find a free shadow agreement identifier from all the agreements for the peer.- Parameters:
peerDN- of consumer peer entry in the supplier DSA.startID- ID to start searching from.- Returns:
- unique agreement ID
-