Class AdminPointUtils

java.lang.Object
com.isode.dsapi.aci.AdminPointUtils

public class AdminPointUtils extends Object
This class contains admin point management related utility methods.
Since:
15.0
Author:
mv
  • Constructor Details

    • AdminPointUtils

      public AdminPointUtils()
  • Method Details

    • installBootStrapACI

      public static void installBootStrapACI(DN dn, DN userDN, DirectorySession ds) throws DSAPIException
      Install bootstrap ACI. It does directory operations so should be called in the background.
      Parameters:
      dn - DN of entry where boot strap ACI needs to be added, must not be null
      userDN - DN of user who will be given permissions, must not be null. If null, a DSAPIException will be thrown
      ds - directory session, must not be null
      Throws:
      DSAPIException - if there are errors when updating the boot strap ACI to DB or if the userDN is null
    • deleteSubentries

      public static void deleteSubentries(DN dn, String oc, DirectorySession ds) throws NoSuchEntryException, BadFilterException, DSAPIException
      Delete subentries with the given objectclass. It does directory operations so should be called in the background.
      Parameters:
      dn - DN of entry whose subentries need to be deleted, must not be null
      oc - objectclass whose subentries need to be deleted, must not be null
      ds - directory session, must not be null
      Throws:
      BadFilterException - if oc is not a valid search filter.
      NoSuchEntryException - if dn does not exist in the directory.
      DSAPIException - if there are errors when reading from DB or when deleting subentries
    • deleteACSubentries

      public static void deleteACSubentries(DN dn, IsodeDirectorySession ds) throws DSAPIException
      Install bootstrap ACI and delete all the AC subentries. It does directory operations so should be called in the background.
      Parameters:
      dn - DN of entry whose subentries need to be deleted, must not be null
      ds - directory session, must not be null
      Throws:
      DSAPIException - if there are errors when updating the boot strap ACI to DB or when deleting subentries
    • deleteAllSubentries

      public static void deleteAllSubentries(DN dn, DN userDN, DirectorySession ds) throws DSAPIException
      If entry is an admin point, then install bootstrap ACI and delete all the subentries. It does directory operations so should be called in the background. It reads the entry to determine if it is an admin point and returns without doing anything if it is not. It also does nothing if the entry has children.
      Parameters:
      dn - DN of entry whose subentries need to be deleted, must not be null
      userDN - DN of user who will be given permissions, must not be null
      ds - directory session, must not be null
      Throws:
      BadValueException - if the BER extracted from the AttributeValue of DSEType is invalid, which may happen over LDAP due to the LDAP string form not being in the Isode-recognised syntax
      DSAPIException - if there are errors when reading the entry or updating the boot strap ACI to DB or when deleting subentries
    • addSubschemaSubentry

      Add a subschema subentry with an empty subtree specification.
      Parameters:
      dn - DN of entry where subentry needs to be added, must not be null
      ds - directory session, must not be null
      Returns:
      an Indication containing the result of the add.
      Throws:
      NotBoundException - if this DirectorySession is not currently bound.
      DirectoryOperationFailedException - if the operation was sent to the directory, and the directory returned an "operation failed" status with no extra indication or information.
      NotImplementedException - if an attempt was made to perform a signed operation on a session which has not been strongly authenticated.
      IndicationException - - the DSA returned an error status as well as an indication which contained supplementary information.
      SignedOpFailedException - if for a signed add, an error occurred when attempting to sign the add request.
      ReferralException - if the directory server returned a referral because it was unwilling or unable to handle the operation.
    • deleteCASubentries

      public static void deleteCASubentries(IsodeDirectorySession ds, DN dn) throws DSAPIException
      Delete all the collective attributes subentries. It should be called from background task.
      Parameters:
      ds - directory session, should not be null
      dn - DN of entry whose subentries need to be deleted, must not be null
      Throws:
      DSAPIException - if there are errors when reading from DB or when deleting subentries
      Since:
      15.1
    • deleteSubschemaSubentries

      public static void deleteSubschemaSubentries(IsodeDirectorySession ds, DN dn) throws DSAPIException
      Delete all the subschema subentries. It should be called from background task.
      Parameters:
      ds - directory session, should not be null
      dn - DN of entry whose subentries need to be deleted, must not be null
      Throws:
      DSAPIException - if there are errors when reading from DB or when deleting subentries
      Since:
      15.1