Class 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 the DataProvider interface, to minimize the effort required to implement this interface.
    • Constructor Detail

      • AbstractDataProvider

        protected AbstractDataProvider()
        Creates a new abstract data provider.
    • Method Detail

      • containsEntry

        public boolean containsEntry​(org.forgerock.opendj.ldap.DN dn)
                              throws org.forgerock.opendj.ldap.LdapException
        Indicates whether this data provider contains the specified entry.

        The default implementation is to invoke getEntry(dn) and return true if the entry was successfully retrieved.

        Specified by:
        containsEntry in interface DataProvider
        Parameters:
        dn - The DN of the entry.
        Returns:
        true if this data provider contains the specified entry, or false if it does not.
        Throws:
        org.forgerock.opendj.ldap.LdapException - If a problem occurs while trying to make the determination, or if dn is not a DN equal to or subordinate to one of the base DNs managed by this data provider.
      • supportsChangeNotification

        public boolean supportsChangeNotification​(org.forgerock.opendj.ldap.DN baseDN)
                                           throws org.forgerock.opendj.ldap.LdapException
        Indicates 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:
        supportsChangeNotification in interface DataProvider
        Parameters:
        baseDN - The base DN in this data provider.
        Returns:
        true if the provided base DN in this data provider supports change notification.
        Throws:
        org.forgerock.opendj.ldap.LdapException - If baseDN is 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.