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