ExportLDIF.java revision 891
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] 868N/A * Portions Copyright 2006-2007 Sun Microsystems, Inc. 0N/A * This program provides a utility that may be used to export the contents of a 0N/A * Directory Server backend to an LDIF file. This will be a process that is 0N/A * intended to run separate from Directory Server and not internally within the 0N/A * server process (e.g., 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. 891N/A * @return The error code. 0N/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 0N/A true,
"{configClass}",
0N/A true,
"{wrapColumn}",
0,
null,
true,
0,
false,
0,
0N/A // Parse the command-line arguments provided to this program. 0N/A // If we should just display usage information, then print it and exit. 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 // FIXME -- Install a custom logger to capture information about the state 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. 0N/A * Retrieves information about the backends defined in the Directory Server 0N/A * @param backendList A list into which instantiated (but not initialized) 0N/A * backend instances will be placed. 0N/A * @param entryList A list into which the config entries associated with 0N/A * the backends will be placed. 0N/A * @param dnList A list into which the set of base DNs for each backend 0N/A // Get the base entry for all backend configuration. 0N/A // Iterate through the immediate children, attempting to parse them as 0N/A // Get the backend ID attribute from the entry. If there isn't one, then 0N/A // Get the backend class name attribute from the entry. If there isn't 0N/A // one, then just skip the entry. 0N/A true,
false,
false);
0N/A // Get the base DN attribute from the entry. If there isn't one, then 0N/A // just skip this entry.