org.apache.directory.server.core
Interface ReferralManager

All Known Implementing Classes:
ReferralManagerImpl

public interface ReferralManager

An interface for managing referrals in the server

Version:
$Rev$, $Date$
Author:
Apache Directory Project

Method Summary
 void addReferral(org.apache.directory.shared.ldap.entry.ServerEntry entry)
          Add a referral to the manager.
 org.apache.directory.shared.ldap.entry.ServerEntry getParentReferral(org.apache.directory.shared.ldap.name.DN dn)
          Get the DN of the parent referral for a specific DN
 boolean hasParentReferral(org.apache.directory.shared.ldap.name.DN dn)
          Tells if this DN has a parent which is a referral.
 void init(DirectoryService directoryService, java.lang.String... suffixes)
          Initialize the manager, reading all the referrals from the base.
 boolean isReferral(org.apache.directory.shared.ldap.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.shared.ldap.name.DN suffix)
          Remove a partition from the manager, reading all the referrals from the base.
 void removeReferral(org.apache.directory.shared.ldap.entry.ServerEntry entry)
          Remove a referral from the manager.
 void unlock()
          Release the read-write lock on the referralManager.
 

Method Detail

lockRead

void lockRead()
Get a read-lock on the referralManager. No read operation can be done on the referralManager if this method is not called before.


lockWrite

void lockWrite()
Get a write-lock on the referralManager. No write operation can be done on the referralManager if this method is not called before.


unlock

void unlock()
Release the read-write lock on the referralManager. This method must be called after having read or modified the ReferralManager


isReferral

boolean isReferral(org.apache.directory.shared.ldap.name.DN dn)
Tells if a DN is a referral (its associated entry contains the Referral ObjectClass). It does not check that the associated entry inherits from a referral.

Parameters:
dn - The entry's DN we want to check
Returns:
true if the DN is associated with a referral

hasParentReferral

boolean hasParentReferral(org.apache.directory.shared.ldap.name.DN dn)
Tells if this DN has a parent which is a referral.
For instance, if cn=example, dc=acme, dc=org is the DN to check, and if dc=acme, dc=org is a referral, this this method will return true.

Parameters:
dn - The DN we want to check for a referral in its partents
Returns:
true if there is a parent referral

getParentReferral

org.apache.directory.shared.ldap.entry.ServerEntry getParentReferral(org.apache.directory.shared.ldap.name.DN dn)
Get the DN of the parent referral for a specific DN

Parameters:
dn - The DN from which we want to get the parent referral
Returns:
The parent referral of null if none is found

addReferral

void addReferral(org.apache.directory.shared.ldap.entry.ServerEntry entry)
Add a referral to the manager.

Parameters:
dn - The referral to add

removeReferral

void removeReferral(org.apache.directory.shared.ldap.entry.ServerEntry entry)
Remove a referral from the manager.

Parameters:
dn - The referral to remove

init

void init(DirectoryService directoryService,
          java.lang.String... suffixes)
          throws java.lang.Exception
Initialize the manager, reading all the referrals from the base. The manager will search for every entries having a Referral ObjectClass.

Parameters:
directoryService - The associated LDAP service
suffixes - The partition list
Throws:
If - the initialization failed
java.lang.Exception

remove

void remove(DirectoryService directoryService,
            org.apache.directory.shared.ldap.name.DN suffix)
            throws java.lang.Exception
Remove a partition from the manager, reading all the referrals from the base. The manager will search for every entries having a Referral ObjectClass, and will remove them from the referrals table.

Parameters:
directoryService - The associated LDAP service
suffixes - The partition DN to remove
Throws:
If - the removal failed
java.lang.Exception


Copyright © 2003-2011 Apache Software Foundation. All Rights Reserved.