public class ReferralManagerImpl extends Object implements ReferralManager
Constructor and Description |
---|
ReferralManagerImpl(DirectoryService directoryService)
Creates a new instance of ReferralManagerImpl.
|
Modifier and Type | Method and Description |
---|---|
void |
addReferral(org.apache.directory.api.ldap.model.entry.Entry entry)
Add a referral to the manager.
|
org.apache.directory.api.ldap.model.entry.Entry |
getParentReferral(org.apache.directory.api.ldap.model.name.Dn dn)
Get the Dn of the parent referral for a specific Dn
|
boolean |
hasParentReferral(org.apache.directory.api.ldap.model.name.Dn dn)
Tells if this Dn has a parent which is a referral.
|
void |
init(DirectoryService directoryService,
String... suffixes)
Initialize the manager, reading all the referrals from the base.
|
boolean |
isReferral(org.apache.directory.api.ldap.model.name.Dn dn)
Tells if a Dn is a referral (its associated entry contains the Referral ObjectClass).
|
void |
lockRead()
Get a read-lock on the referralManager.
|
void |
lockWrite()
Get a write-lock on the referralManager.
|
void |
remove(DirectoryService directoryService,
org.apache.directory.api.ldap.model.name.Dn suffix)
Remove a partition from the manager, reading all the referrals from the base.
|
void |
removeReferral(org.apache.directory.api.ldap.model.entry.Entry entry)
Remove a referral from the manager.
|
void |
unlock()
Release the read-write lock on the referralManager.
|
public ReferralManagerImpl(DirectoryService directoryService) throws org.apache.directory.api.ldap.model.exception.LdapException
directoryService
- The directory serviceorg.apache.directory.api.ldap.model.exception.LdapException
- If we can't initialize the managerpublic void lockRead()
lockRead
in interface ReferralManager
public void lockWrite()
lockWrite
in interface ReferralManager
public void unlock()
unlock
in interface ReferralManager
public void addReferral(org.apache.directory.api.ldap.model.entry.Entry entry)
addReferral
in interface ReferralManager
entry
- The referral to addpublic void init(DirectoryService directoryService, String... suffixes) throws org.apache.directory.api.ldap.model.exception.LdapException
init
in interface ReferralManager
directoryService
- The associated LDAP servicesuffixes
- The partition listorg.apache.directory.api.ldap.model.exception.LdapException
public void remove(DirectoryService directoryService, org.apache.directory.api.ldap.model.name.Dn suffix) throws Exception
remove
in interface ReferralManager
directoryService
- The associated LDAP servicesuffix
- The partition Dn to removeException
- If the removal failedpublic boolean hasParentReferral(org.apache.directory.api.ldap.model.name.Dn dn)
hasParentReferral
in interface ReferralManager
dn
- The Dn we want to check for a referral in its partentstrue
if there is a parent referralpublic org.apache.directory.api.ldap.model.entry.Entry getParentReferral(org.apache.directory.api.ldap.model.name.Dn dn)
getParentReferral
in interface ReferralManager
dn
- The Dn from which we want to get the parent referralpublic boolean isReferral(org.apache.directory.api.ldap.model.name.Dn dn)
isReferral
in interface ReferralManager
dn
- The entry's Dn we want to checktrue
if the Dn is associated with a referralpublic void removeReferral(org.apache.directory.api.ldap.model.entry.Entry entry) throws org.apache.directory.api.ldap.model.exception.LdapException
removeReferral
in interface ReferralManager
entry
- The referral to removeorg.apache.directory.api.ldap.model.exception.LdapException
- If the referal can't be removedCopyright © 2003–2020 The Apache Software Foundation. All rights reserved.