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 * You can obtain a copy of the license at 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 0N/A * file and include the License file at 0N/A * add the following below this CDDL HEADER, with the fields enclosed 873N/A * by brackets "[]" replaced with your own identifying information: 0N/A * Portions Copyright [yyyy] [name of copyright owner] 4289N/A * Copyright 2006-2009 Sun Microsystems, Inc. 6238N/A * Portions copyright 2012-2013 ForgeRock AS. 0N/A * This program provides a utility that may be used to export the contents of a 2187N/A * Directory Server backend to an LDIF file. Depending on the arguments given, 2187N/A * this program will either perform the export directly as a process that 2187N/A * runs separate from Directory Server; or by scheduling a task to perform the 2187N/A * action within the Directory Server via the tasks interface. 0N/A * The main method for ExportLDIF tool. 0N/A * @param args The command-line arguments provided to this program. 0N/A * Processes the command-line arguments and invokes the export process. 0N/A * @param args The command-line arguments provided to this program. 0N/A * @return The error code. 891N/A * Processes the command-line arguments and invokes the export process. 891N/A * @param args The command-line arguments provided to this 891N/A * @param initializeServer Indicates whether to initialize the server. 1795N/A * @param outStream The output stream to use for standard output, or 1795N/A * {@code null} if standard output is not needed. 1795N/A * @param errStream The output stream to use for standard error, or 1795N/A * {@code null} if standard error is not needed. 891N/A * @return The error code. 2187N/A // Define the command-line arguments that may be used with this program. 0N/A // Create the command-line argument parser for use with this program. 0N/A // Initialize all the command-line argument types and register them with the 2086N/A "appendldif",
'a',
"appendToLDIF",
2086N/A "includeattribute",
'i',
"includeAttribute",
2086N/A "excludeattribute",
'e',
"excludeAttribute",
4360N/A // Init the default values so that they can appear also on the usage. 0N/A // Parse the command-line arguments provided to this program. 4289N/A // No need to display the usage since the problem comes with a provided 1340N/A // If we should just display usage or version information, 6238N/A // Checks the version - if upgrade required, the tool is unusable 0N/A // Perform the initial bootstrap of the Directory Server and process the 891N/A // Initialize the Directory Server schema elements. 891N/A // Initialize the Directory Server core configuration. 891N/A // Initialize the Directory Server crypto manager. 891N/A // Make sure that the Directory Server plugin initialization is performed. 0N/A // filters. If so, then process them. 0N/A // Get information about the backends defined in the server. Iterate 0N/A // through them, finding the one backend that should be used for the export, 0N/A // and also finding backends with subordinate base DNs that should be 0N/A // excluded from the export. 0N/A // Create the LDIF export configuration to use when reading the LDIF. 0N/A // FIXME -- Should this be conditional? 0N/A // Get the set of base DNs for the backend as an array. 0N/A // Acquire a shared lock for the backend. 0N/A // Launch the export. 0N/A // Release the shared lock on the backend. 0N/A // Clean up after the export by closing the export config.