Package org.forgerock.opendj.server.core
Class AbstractDataProvider
- java.lang.Object
-
- org.forgerock.opendj.server.core.AbstractDataProvider
-
- All Implemented Interfaces:
org.forgerock.opendj.ldap.RequestHandler<Operation>,DataProvider
public abstract class AbstractDataProvider extends Object implements DataProvider
This class provides a skeletal implementation of theDataProviderinterface, to minimize the effort required to implement this interface.
-
-
Constructor Summary
Constructors Modifier Constructor Description protectedAbstractDataProvider()Creates a new abstract data provider.
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description booleancontainsEntry(org.forgerock.opendj.ldap.DN dn)Indicates whether this data provider contains the specified entry.voidderegisterEventListener(DataProviderEventListener listener)Deregisters an event listener from this data provider.protected voidnotifyDataProviderEventOccurred(org.forgerock.i18n.LocalizableMessage reason, Set<DataProviderEvent.Type> types)Notify all event listeners that this data provider has changed state due to an operational error, configuration change, or an administrative action.protected voidnotifyDataProviderEventOccurred(DataProviderEvent event)Notify all event listeners that this data provider has changed state due to an operational error, configuration change, or an administrative action.voidregisterEventListener(DataProviderEventListener listener)Registers an event listener with this data provider.booleansupportsChangeNotification(org.forgerock.opendj.ldap.DN baseDN)Indicates whether the provided base DN in this data provider supports change notification.-
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
-
Methods inherited from interface org.forgerock.opendj.server.core.DataProvider
finalizeDataProvider, getBaseDNs, getEntry, getStatus, getSupportedControls, getSupportedFeatures, startDataProvider, stopDataProvider
-
-
-
-
Method Detail
-
containsEntry
public boolean containsEntry(org.forgerock.opendj.ldap.DN dn) throws org.forgerock.opendj.ldap.LdapExceptionIndicates whether this data provider contains the specified entry.The default implementation is to invoke
getEntry(dn)and returntrueif the entry was successfully retrieved.- Specified by:
containsEntryin interfaceDataProvider- Parameters:
dn- The DN of the entry.- Returns:
trueif this data provider contains the specified entry, orfalseif it does not.- Throws:
org.forgerock.opendj.ldap.LdapException- If a problem occurs while trying to make the determination, or ifdnis not a DN equal to or subordinate to one of the base DNs managed by this data provider.
-
deregisterEventListener
public final void deregisterEventListener(DataProviderEventListener listener)
Deregisters an event listener from this data provider.- Specified by:
deregisterEventListenerin interfaceDataProvider- Parameters:
listener- The event listener.
-
registerEventListener
public final void registerEventListener(DataProviderEventListener listener)
Registers an event listener with this data provider.- Specified by:
registerEventListenerin interfaceDataProvider- Parameters:
listener- The event listener.
-
supportsChangeNotification
public boolean supportsChangeNotification(org.forgerock.opendj.ldap.DN baseDN) throws org.forgerock.opendj.ldap.LdapExceptionIndicates whether the provided base DN in this data provider supports change notification.The default implementation is to return false for all base DNs indicating that change notification is not supported.
- Specified by:
supportsChangeNotificationin interfaceDataProvider- Parameters:
baseDN- The base DN in this data provider.- Returns:
trueif the provided base DN in this data provider supports change notification.- Throws:
org.forgerock.opendj.ldap.LdapException- IfbaseDNis not one of the base DNs managed by this data provider.
-
notifyDataProviderEventOccurred
protected final void notifyDataProviderEventOccurred(DataProviderEvent event)
Notify all event listeners that this data provider has changed state due to an operational error, configuration change, or an administrative action.This method can be used to forward events to parent data providers.
- Parameters:
event- The data provider event.
-
notifyDataProviderEventOccurred
protected final void notifyDataProviderEventOccurred(org.forgerock.i18n.LocalizableMessage reason, Set<DataProviderEvent.Type> types)Notify all event listeners that this data provider has changed state due to an operational error, configuration change, or an administrative action.This method is equivalent to the following code:
DataProviderEvent event = new DataProviderEvent(reason, types); notifyDataProviderStateChanged(event);
- Parameters:
reason- A message describing this event.types- The types of event that have occurred in the data provider.
-
-