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.RestoreConfig;
020
021/**
022 * This interface defines a set of methods that may be used to notify
023 * various Directory Server components whenever a backend restore task
024 * is about to begin or has just completed.  Note that these methods
025 * will only be invoked for the restore task and not for offline
026 * restore 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 RestoreTaskListener
034{
035  /**
036   * Performs any processing that might be necessary just before the
037   * server begins processing on a restore task.  This should include
038   * pausing interaction with the provided backend while the restore
039   * is in progress.
040   *
041   * @param  backend  The backend to be restored.
042   * @param  config   Configuration information about the restore to
043   *                  be performed.
044   */
045  void processRestoreBegin(Backend<?> backend, RestoreConfig config);
046
047  /**
048   * Performs any processing that might be necessary after the server
049   * has completed processing on a restore task.  Note that this will
050   * always be called when restore processing completes, regardless of
051   * whether it was successful.
052   *
053   * @param  backend     The backend that was restored.
054   * @param  config      Configuration information about the restore
055   *                     that was performed.
056   * @param  successful  Indicates whether the restore operation
057   *                     completed successfully.
058   */
059  void processRestoreEnd(Backend<?> backend, RestoreConfig config, boolean successful);
060}