Class ShadowManager

java.lang.Object
com.isode.dsapi.config.ShadowManager

public class ShadowManager extends Object
Shadow agreement manager manages the various entries stored in the directory session.
Since:
15.0
Author:
mv
  • Constructor Details

    • ShadowManager

      public ShadowManager(IsodeDirectorySession ds)
      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 loaded
      ReadFailedException - 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

      public boolean deleteConsumer(DN dsaDN, DN prefixDN) throws ConfigOpFailedException
      Remove a consumer agreement based on the given parameters.
      Parameters:
      dsaDN - DSA DN
      prefixDN - Prefix DN
      Returns:
      TRUE if the consumer agreement corresponding to the given parameters was found, FALSE otherwise
      Throws:
      ConfigOpFailedException - if the operation failed.
    • deleteSupplier

      public boolean deleteSupplier(DN dsaDN, DN prefixDN) throws ConfigOpFailedException
      Remove a supplier agreement based on the given parameters.
      Parameters:
      dsaDN - DSA DN
      prefixDN - Prefix DN
      Returns:
      TRUE if the supplier agreement corresponding to the given parameters was found, FALSE otherwise
      Throws:
      ConfigOpFailedException - if the operation failed.
    • getSupplier

      public LinkedList<SupplierAgreement> getSupplier()
      Get the set of supplier agreements.
      Returns:
      list of supplier agreements
    • getConsumer

      public LinkedList<ConsumerAgreement> getConsumer()
      Get the set of consumer agreements.
      Returns:
      list of consumer agreements
    • getConsumer

      public ConsumerAgreement getConsumer(DN dsaDN, DN prefixDN)
      Find a consumer agreement.
      Parameters:
      dsaDN - DSA DN
      prefixDN - Prefix DN
      Returns:
      consumer agreement found or null if not found
    • getSupplier

      public SupplierAgreement getSupplier(DN dsaDN, DN prefixDN)
      Find a supplier agreement.
      Parameters:
      dsaDN - DSA DN
      prefixDN - Prefix DN
      Returns:
      supplier agreement found or null if not found
    • getAgreement

      public ShadowAgreement getAgreement(DN dsaDN, int agreementId)
      Find an agreement for the given agreement id and DSA DN.
      Parameters:
      dsaDN - DSA DN
      agreementId - Agreement ID
      Returns:
      supplier agreement found or null if not found
    • newAgreementID

      public int newAgreementID(DN peerDN, int startID)
      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