0N/A * The contents of this file are subject to the terms of the 0N/A * Common Development and Distribution License, Version 1.0 only 0N/A * (the "License"). You may not use this file except in compliance 0N/A * See the License for the specific language governing permissions 0N/A * and limitations under the License. 0N/A * When distributing Covered Code, include this CDDL HEADER in each 6983N/A * If applicable, add the following below this CDDL HEADER, with the 6983N/A * fields enclosed by brackets "[]" replaced with your own identifying 0N/A * Portions Copyright [yyyy] [name of copyright owner] 3215N/A * Copyright 2006-2008 Sun Microsystems, Inc. 0N/A * This class provides an implementation of a Directory Server task that may be 0N/A * used to back up a Directory Server backend in a binary form that may be 0N/A * quickly archived and restored. 2488N/A * Stores mapping between configuration attribute name and its label. 266N/A * All the backend configuration entries defined in the server mapped 776N/A // If the client connection is available, then make sure the associated 776N/A // client has the BACKEND_BACKUP privilege. 266N/A * Validate the task arguments and construct the list of backends to be 266N/A * @return true if the task arguments are valid. 0N/A // Make sure that either the backUpAll argument was provided or at least one 0N/A // backend ID was given. They are mutually exclusive. 4005N/A // Use task id for backup id in case of recurring task. 0N/A // If no backup ID was provided, then create one with the current timestamp. 0N/A // If the incremental base ID was specified, then make sure it is an 0N/A // incremental backup. 0N/A // If the signHash option was provided, then make sure that the hash option 0N/A // Make sure that the backup directory exists. If not, then create it. 0N/A // Iterate through the set of requested backends and make sure they can 0N/A // It is an error if any of the requested backends could not be used. 0N/A // If there are no backends to archive, then print an error and exit. 266N/A * Archive a single backend, where the backend is known to support backups. 266N/A * @param b The backend to be archived. 266N/A * @param backupLocation The backup directory. 266N/A * @return true if the backend was successfully archived. 266N/A // Get the config entry for this backend. 266N/A // If the directory doesn't exist, then create it. If it does exist, then 266N/A // see if it has a backup descriptor file. 3993N/A // Check the current backup directory corresponds to the provided 274N/A // Create a backup configuration. 266N/A * Acquire a shared lock on a backend. 266N/A * @param b The backend on which the lock is to be acquired. 266N/A * @return true if the lock was successfully acquired. 266N/A * Release a lock on a backend. 266N/A * @param b The backend on which the lock is held. 266N/A * @return true if the lock was successfully released. 266N/A // We'll proceed as if we're backing up multiple backends in this case 266N/A // even if there's just one. 266N/A // See if there are multiple backends to archive. 0N/A // Iterate through the backends to archive and back them up individually. 0N/A // Acquire a shared lock for this backend. 266N/A // Get the path to the directory to use for this backup. If we will be 266N/A // backing up multiple backends (or if we are backing up all backends, 266N/A // even if there's only one of them), then create a subdirectory for 266N/A // Release the shared lock for the backend. 0N/A // Print a final completed message, indicating whether there were any errors 3115N/A // in the process. In this case it means that the backup could not be 3115N/A // completed at least for one of the backends.