001/*
002 * The contents of this file are subject to the terms of the Common Development and
003 * Distribution License (the License). You may not use this file except in compliance with the
004 * License.
005 *
006 * You can obtain a copy of the License at legal/CDDLv1.0.txt. See the License for the
007 * specific language governing permission and limitations under the License.
008 *
009 * When distributing Covered Software, include this CDDL Header Notice in each file and include
010 * the License file at legal/CDDLv1.0.txt. If applicable, add the following below the CDDL
011 * Header, with the fields enclosed by brackets [] replaced by your own identifying
012 * information: "Portions Copyright [year] [name of copyright owner]".
013 *
014 * Copyright 2006-2008 Sun Microsystems, Inc.
015 * Portions Copyright 2015 ForgeRock AS.
016 */
017package org.opends.server.api;
018
019
020
021import org.opends.server.types.LDIFExportConfig;
022
023
024
025/**
026 * This interface defines a set of methods that may be used to notify
027 * various Directory Server components whenever an LDIF export task is
028 * about to begin or has just completed.  Note that these methods will
029 * only be invoked for the LDIF export task and not for offline LDIF
030 * export processing.
031 */
032@org.opends.server.types.PublicAPI(
033     stability=org.opends.server.types.StabilityLevel.VOLATILE,
034     mayInstantiate=false,
035     mayExtend=true,
036     mayInvoke=false)
037public interface ExportTaskListener
038{
039  /**
040   * Performs any processing that might be necessary just before the
041   * server begins processing on an LDIF export task.  This may
042   * include flushing any outstanding writes to disk so they are
043   * included in the export and/or pausing interaction with the
044   * provided backend while the export is in progress.
045   *
046   * @param  backend  The backend to be exported.
047   * @param  config   Configuration information about the LDIF export
048   *                  to be performed.
049   */
050  void processExportBegin(Backend backend,
051                                 LDIFExportConfig config);
052
053
054
055  /**
056   * Performs any processing that might be necessary after the server
057   * has completed processing on an LDIF export task.  Note that this
058   * will always be called when export processing completes,
059   * regardless of whether it was successful.
060   *
061   * @param  backend     The backend that was exported.
062   * @param  config      Configuration information about the LDIF
063   *                     export that was performed.
064   * @param  successful  Indicates whether the export operation
065   *                     completed successfully.
066   */
067  void processExportEnd(Backend backend,
068                               LDIFExportConfig config,
069                               boolean successful);
070}
071