001/*
002* CDDL HEADER START
003 *
004 * The contents of this file are subject to the terms of the
005 * Common Development and Distribution License, Version 1.0 only
006 * (the "License").  You may not use this file except in compliance
007 * with the License.
008 *
009 * You can obtain a copy of the license at legal-notices/CDDLv1_0.txt
010 * or http://forgerock.org/license/CDDLv1.0.html.
011 * See the License for the specific language governing permissions
012 * and limitations under the License.
013 *
014 * When distributing Covered Code, include this CDDL HEADER in each
015 * file and include the License file at legal-notices/CDDLv1_0.txt.
016 * If applicable, add the following below this CDDL HEADER, with the
017 * fields enclosed by brackets "[]" replaced with your own identifying
018 * information:
019 *      Portions Copyright [yyyy] [name of copyright owner]
020 *
021 * CDDL HEADER END
022 *
023 *
024 *      Copyright 2008-2009 Sun Microsystems, Inc.
025 *      Portions copyright 2013 ForgeRock AS.
026 */
027package org.forgerock.opendj.server.core;
028
029/**
030 * An object that registers to be notified of events generated by a
031 * {@link DataProviderConnection} object. Data provider events may be triggered
032 * as a result of:
033 * <ul>
034 * <li>The data provider connection being closed.
035 * <li>An operational error. For example, a proxy data provider might lose
036 * connectivity with the remote server.
037 * <li>A configuration change. For example, a data provider may be disabled, or
038 * have a new base DN added.
039 * <li>An administrative action. For example, a data provider may be temporarily
040 * disabled during an import or restore from backup.
041 * </ul>
042 * In the case of configuration changes, the data provider will only notify its
043 * listeners once the configuration change has been applied. If a listener
044 * wishes to validate configuration changes before they are applied to a data
045 * provider then the listener should use the registration methods provided by
046 * {@code DataProviderCfg}.
047 */
048public interface DataProviderEventListener {
049
050    /**
051     * The data provider has changed state due to an operational error,
052     * configuration change, or an administrative action.
053     * <p>
054     * Implementations should examine the provided {@link DataProviderEvent} in
055     * order to determine how the data provider has changed.
056     *
057     * @param event
058     *            The data provider event.
059     */
060    void handleDataProviderEvent(DataProviderEvent event);
061
062}