Package com.isode.dsapi.aci
Class AdminPointUtils
java.lang.Object
com.isode.dsapi.aci.AdminPointUtils
This class contains admin point management related utility methods.
- Since:
- 15.0
- Author:
- mv
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionstatic Indication
addSubschemaSubentry
(DN dn, DirectorySession ds) Add a subschema subentry with an empty subtree specification.static void
Install bootstrap ACI and delete all the AC subentries.static void
deleteAllSubentries
(DN dn, DN userDN, DirectorySession ds) If entry is an admin point, then install bootstrap ACI and delete all the subentries.static void
Delete all the collective attributes subentries.static void
deleteSubentries
(DN dn, String oc, DirectorySession ds) Delete subentries with the given objectclass.static void
Delete all the subschema subentries.static void
installBootStrapACI
(DN dn, DN userDN, DirectorySession ds) Install bootstrap ACI.
-
Constructor Details
-
AdminPointUtils
public AdminPointUtils()
-
-
Method Details
-
installBootStrapACI
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 nulluserDN
- DN of user who will be given permissions, must not be null. If null, a DSAPIException will be thrownds
- 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 nulloc
- objectclass whose subentries need to be deleted, must not be nullds
- 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
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 nullds
- 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
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 nulluserDN
- DN of user who will be given permissions, must not be nullds
- directory session, must not be null- Throws:
BadValueException
- if the BER extracted from the AttributeValue ofDSEType
is invalid, which may happen over LDAP due to the LDAP string form not being in the Isode-recognised syntaxDSAPIException
- if there are errors when reading the entry or updating the boot strap ACI to DB or when deleting subentries
-
addSubschemaSubentry
public static Indication addSubschemaSubentry(DN dn, DirectorySession ds) throws ReferralException, NotBoundException, DirectoryOperationFailedException, NotImplementedException, IndicationException, SignedOpFailedException Add a subschema subentry with an empty subtree specification.- Parameters:
dn
- DN of entry where subentry needs to be added, must not be nullds
- 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
Delete all the collective attributes subentries. It should be called from background task.- Parameters:
ds
- directory session, should not be nulldn
- 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
Delete all the subschema subentries. It should be called from background task.- Parameters:
ds
- directory session, should not be nulldn
- 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
-