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-2016 ForgeRock AS.
016 */
017package org.opends.server.api;
018
019import org.opends.server.types.BackupConfig;
020
021/**
022 * This interface defines a set of methods that may be used to notify
023 * various Directory Server components whenever a backend backup task
024 * is about to begin or has just completed.  Note that these methods
025 * will only be invoked for the backup task and not for offline backup
026 * processing.
027 */
028@org.opends.server.types.PublicAPI(
029     stability=org.opends.server.types.StabilityLevel.VOLATILE,
030     mayInstantiate=false,
031     mayExtend=true,
032     mayInvoke=false)
033public interface BackupTaskListener
034{
035  /**
036   * Performs any processing that might be necessary just before the
037   * server begins processing on a backup task.  This may include
038   * flushing any outstanding writes to disk so they are included in
039   * the backup and/or pausing interaction with the provided backend
040   * while the backup is in progress.
041   *
042   * @param  backend  The backend to be archived.
043   * @param  config   Configuration information about the backup to be
044   *                  performed.
045   */
046  void processBackupBegin(Backend<?> backend, BackupConfig config);
047
048  /**
049   * Performs any processing that might be necessary after the server
050   * has completed processing on a backup task.  Note that this will
051   * always be called when backup processing completes, regardless of
052   * whether it was successful.
053   *
054   * @param  backend     The backend that was archived.
055   * @param  config      Configuration information about the backup
056   *                     that was performed.
057   * @param  successful  Indicates whether the backup operation
058   *                     completed successfully.
059   */
060  void processBackupEnd(Backend<?> backend, BackupConfig config, boolean successful);
061}