DirectoryServer.java revision 83efeeb66bc183b219c55fb6b96f9f78e997e0ad
/*
* CDDL HEADER START
*
* The contents of this file are subject to the terms of the
* Common Development and Distribution License, Version 1.0 only
* (the "License"). You may not use this file except in compliance
* with the License.
*
* You can obtain a copy of the license at
* See the License for the specific language governing permissions
* and limitations under the License.
*
* When distributing Covered Code, include this CDDL HEADER in each
* file and include the License file at
* trunk/opends/resource/legal-notices/OpenDS.LICENSE. If applicable,
* add the following below this CDDL HEADER, with the fields enclosed
* by brackets "[]" replaced with your own identifying information:
* Portions Copyright [yyyy] [name of copyright owner]
*
* CDDL HEADER END
*
*
* Portions Copyright 2006-2007 Sun Microsystems, Inc.
*/
/**
* This class defines the core of the Directory Server. It manages the startup
* and shutdown processes and coordinates activities between all other
* components.
*/
public class DirectoryServer
{
/**
* The tracer object for the debug logger.
*/
/**
* The fully-qualified name of this class.
*/
private static final String CLASS_NAME =
"org.opends.server.core.DirectoryServer";
/**
* The singleton Directory Server instance.
*/
/**
* Indicates whether the server currently holds an exclusive lock on the
* server lock fiie.
*/
private static boolean serverLocked = false;
/**
* Return codes used when the hidden option --checkStartability is used.
* NOTE: when checkstartability is specified is recommended not to allocate
* a lot of memory for the JVM (Using -Xms and -Xmx options) as there might
* be calls to Runtime.exec.
*/
/**
* Returned when the user specified the --checkStartability option with other
* options like printing the usage, dumping messages, displaying version, etc.
*/
private static int NOTHING_TO_DO = 0;
/**
* Returned when the user specified the --checkStartability option with
* some incompatible arguments.
*/
private static int CHECK_ERROR = 1;
/**
* The server is already started.
*/
private static int SERVER_ALREADY_STARTED = 98;
/**
* The server must be started as detached process.
*/
private static int START_AS_DETACH = 99;
/**
* The server must be started as a non-detached process.
*/
private static int START_AS_NON_DETACH = 100;
/**
* The server must be started as a window service.
*/
private static int START_AS_WINDOWS_SERVICE = 101;
/**
* The server must be started as detached and it is being called from the
* Windows Service.
*/
private static int START_AS_DETACH_CALLED_FROM_WINDOWS_SERVICE = 102;
/**
* The server must be started as detached process and should not produce any
* output.
*/
private static int START_AS_DETACH_QUIET = 103;
// The policy to use regarding single structural objectclass enforcement.
// The policy to use regarding syntax enforcement.
private AcceptRejectWarn syntaxEnforcementPolicy;
// The account status notification handler config manager for the server.
// The default syntax to use for binary attributes.
// The default syntax to use for Boolean attributes.
// The default syntax to use for DN attributes.
// The default syntax to use for integer attributes.
// The default syntax to use for string attributes.
// The default attribute syntax to use for attributes with no defined syntax.
// The attribute type used to reference the "objectclass" attribute.
private AttributeType objectClassAttributeType;
// The authenticated users manager for the server.
private AuthenticatedUsers authenticatedUsers;
// The configuration manager that will handle the server backends.
private BackendConfigManager backendConfigManager;
// Indicates whether to automatically add missing RDN attributes to entries
// during an add request.
private boolean addMissingRDNAttributes;
// Indicates whether to allow attribute name exceptions (i.e., attribute names
// can contain underscores and may start with a digit).
private boolean allowAttributeNameExceptions;
// Indicates whether a simple bind request containing a DN must also provide a
// password.
private boolean bindWithDNRequiresPassword;
// Indicates whether the Directory Server should perform schema checking for
// update operations.
private boolean checkSchema;
// Indicates whether the server has been bootstrapped.
private boolean isBootstrapped;
// Indicates whether the server has been bootstrapped for client use.
private boolean isClientBootstrapped;
// Indicates whether the server is currently online.
private boolean isRunning;
// Indicates whether the server is currently in "lockdown mode".
private boolean lockdownMode;
// Indicates whether the server should send a response to operations that have
// been abandoned.
private boolean notifyAbandonedOperations;
// Indicates whether to save a copy of the configuration on successful
// startup.
private boolean saveConfigOnSuccessfulStartup;
// Indicates whether the server is currently in the process of shutting down.
private boolean shuttingDown;
// Indicates whether the server should reject unauthenticated requests.
private boolean rejectUnauthenticatedRequests;
// Indicates whether bind responses should include failure reason messages.
private boolean returnBindErrorMessages;
// The configuration manager that will handle the certificate mapper.
// The class used to provide the config handler implementation.
private Class configClass;
// The configuration handler for the Directory Server.
private ConfigHandler configHandler;
// The set of account status notification handlers defined in the server.
// The set of certificate mappers registered with the server.
// The set of alternate bind DNs for the root users.
// The set of identity mappers registered with the server (mapped between
// the configuration entry Dn and the mapper).
// The set of JMX MBeans that have been registered with the server (mapped
// between the associated configuration entry DN and the MBean).
// The set of key manager providers registered with the server.
// The set of password generators registered with the Directory Server, as a
// mapping between the DN of the associated configuration entry and the
// generator implementation.
// The set of password policies registered with the Directory Server, as a
// mapping between the DN of the associated configuration entry and the policy
// implementation.
// The set of password validators registered with the Directory Server, as a
// mapping between the DN of the associated configuration entry and the
// validator implementation.
private ConcurrentHashMap<DN,
PasswordValidator<? extends PasswordValidatorCfg>>
// The set of trust manager providers registered with the server.
// The set of log rotation policies registered with the Directory Server, as
// a mapping between the DN of the associated configuration entry and the
// policy implementation.
// The set of log retention policies registered with the Directory Server, as
// a mapping between the DN of the associated configuration entry and the
// policy implementation.
// The set of extended operation handlers registered with the server (mapped
// between the OID of the extended operation and the handler).
// The set of monitor providers registered with the Directory Server, as a
// mapping between the monitor name and the corresponding implementation.
private ConcurrentHashMap<String,
MonitorProvider<? extends MonitorProviderCfg>>
// The set of password storage schemes defined in the server (mapped between
// the lowercase scheme name and the storage scheme) that support the
// authentication password syntax.
// The set of password storage schemes defined in the server (mapped between
// the lowercase scheme name and the storage scheme).
// The set of password storage schemes defined in the server (mapped between
// the DN of the configuration entry and the storage scheme).
// The set of SASL mechanism handlers registered with the server (mapped
// between the mechanism name and the handler).
// The connection handler configuration manager for the Directory Server.
// The set of alert handlers registered with the Directory Server.
// The set of backup task listeners registered with the Directory Server.
// The set of change notification listeners registered with the Directory
// Server.
// The set of connection handlers registered with the Directory Server.
// The set of export task listeners registered with the Directory Server.
// The set of import task listeners registered with the Directory Server.
// The set of persistent searches registered with the Directory Server.
// The set of restore task listeners registered with the Directory Server.
// The set of shutdown listeners that have been registered with the Directory
// Server.
// The set of synchronization providers that have been registered with the
// Directory Server.
private
// The set of virtual attributes defined in the server.
// The set of backend initialization listeners registered with the Directory
// Server.
// The set of root DNs registered with the Directory Server.
// The core configuration manager for the Directory Server.
private CoreConfigManager coreConfigManager;
// The crypto manager for the Directory Server.
private CryptoManager cryptoManager;
// The default compressed schema manager.
private DefaultCompressedSchema compressedSchema;
// The environment configuration for the Directory Server.
// The shutdown hook that has been registered with the server.
private DirectoryServerShutdownHook shutdownHook;
// The DN of the default password policy configuration entry.
private DN defaultPasswordPolicyDN;
// The DN of the identity mapper that will be used to resolve authorization
// IDs contained in the proxied authorization V2 control.
private DN proxiedAuthorizationIdentityMapperDN;
// The DN of the entry containing the server schema definitions.
// The Directory Server entry cache.
private EntryCache entryCache;
// The configuration manager for the entry cache.
// The configuration manager for extended operation handlers.
// The path to the file containing the Directory Server configuration, or the
// information needed to bootstrap the configuration handler.
private File configFile;
// The group manager for the Directory Server.
private GroupManager groupManager;
// The configuration manager for identity mappers.
// The maximum number of entries that should be returned for a search unless
// overridden on a per-user basis.
private int sizeLimit;
// The maximum length of time in seconds that should be allowed for a search
// unless overridden on a per-user basis.
private int timeLimit;
// The maxiumum number of candidates that should be check for matches during
// a search.
private int lookthroughLimit;
// The key manager provider configuration manager for the Directory Server.
// The set of connections that are currently established.
// The sets of mail server properties
// The set of schema changes made by editing the schema configuration files
// with the server offline.
// The log rotation policy config manager for the Directory Server.
// The log retention policy config manager for the Directory Server.
// The logger configuration manager for the Directory Server.
private LoggerConfigManager loggerConfigManager;
// The number of connections currently established to the server.
private long currentConnections;
// The idle time limit for the server.
private long idleTimeLimit;
// The maximum number of connections that will be allowed at any given time.
private long maxAllowedConnections;
// The maximum number of connections established at one time.
private long maxConnections;
// The time that this Directory Server instance was started.
private long startUpTime;
// The total number of connections established since startup.
private long totalConnections;
// The MBean server used to handle JMX interaction.
private MBeanServer mBeanServer;
// The monitor config manager for the Directory Server.
private MonitorConfigManager monitorConfigManager;
// The operating system on which the server is running.
private OperatingSystem operatingSystem;
// The configuration handler used to manage the password generators.
// The default password policy for the Directory Server.
// The configuration handler used to manage the password policies.
// The configuration handler used to manage the password storage schemes.
// The configuration handler used to manage the password validators.
// The plugin config manager for the Directory Server.
private PluginConfigManager pluginConfigManager;
// The result code that should be used for internal "server" errors.
private ResultCode serverErrorResultCode;
// The special backend used for the Directory Server root DSE.
private RootDSEBackend rootDSEBackend;
// The root DN config manager for the server.
private RootDNConfigManager rootDNConfigManager;
// The SASL mechanism config manager for the Directory Server.
private SASLConfigManager saslConfigManager;
// The schema for the Directory Server.
// The schema configuration manager for the Directory Server.
private SchemaConfigManager schemaConfigManager;
// The set of disabled privileges.
// The set of allowed task classes.
// The time that the server was started, formatted in UTC time.
private String startTimeUTC;
// The synchronization provider configuration manager for the Directory
// Server.
// The thread group for all threads associated with the Directory Server.
private ThreadGroup directoryThreadGroup;
// Registry for base DN and naming context information.
private BaseDnRegistry baseDnRegistry;
// The set of backends registered with the server.
// The mapping between backends and their unique indentifiers for their
// offline state, representing either checksum or other unique value to
// be used for detecting any offline modifications to a given backend.
// The set of supported controls registered with the Directory Server.
// The set of supported feature OIDs registered with the Directory Server.
// The trust manager provider configuration manager for the Directory Server.
// The virtual attribute provider configuration manager for the Directory
// Server.
// The work queue that will be used to service client requests.
// The writability mode for the Directory Server.
private WritabilityMode writabilityMode;
/**
* Creates a new instance of the Directory Server. This will allow only a
* single instance of the server per JVM.
*/
private DirectoryServer()
{
this(new DirectoryEnvironmentConfig());
}
/**
* Creates a new instance of the Directory Server. This will allow only a
* single instance of the server per JVM.
*
* @param config The environment configuration to use for the Directory
* Server instance.
*/
{
isBootstrapped = false;
isClientBootstrapped = false;
isRunning = false;
shuttingDown = false;
lockdownMode = false;
}
/**
* Retrieves the instance of the Directory Server that is associated with this
* JVM.
*
* @return The instance of the Directory Server that is associated with this
* JVM.
*/
public static DirectoryServer getInstance()
{
return directoryServer;
}
/**
* Creates a new instance of the Directory Server and replaces the static
* reference to it. This should only be used in the context of an in-core
* restart after the existing server has been shut down.
*
* @param config The environment configuration for the Directory Server.
*
* @return The new instance of the Directory Server that is associated with
* this JVM.
*/
private static DirectoryServer
{
synchronized (directoryServer)
{
}
}
/**
* Retrieves the environment configuration for the Directory Server.
*
* @return The environment configuration for the Directory Server.
*/
public static DirectoryEnvironmentConfig getEnvironmentConfig()
{
return directoryServer.environmentConfig;
}
/**
* Sets the environment configuration for the Directory Server. This method
* may only be invoked when the server is not running.
*
* @param config The environment configuration for the Directory Server.
*
* @throws InitializationException If the Directory Server is currently
* running.
*/
throws InitializationException
{
if (isRunning)
{
throw new InitializationException(
}
}
/**
* Indicates whether the Directory Server is currently running.
*
* @return {@code true} if the server is currently running, or {@code false}
* if not.
*/
public static boolean isRunning()
{
return directoryServer.isRunning;
}
/**
* Bootstraps the appropriate Directory Server structures that may be needed
* by client-side tools. This is not intended for use in running the server
* itself.
*/
public static void bootstrapClient()
{
synchronized (directoryServer)
{
{
return;
}
// Set default values for variables that may be needed during schema
// processing.
// Create the server schema and initialize and register a minimal set of
// matching rules and attribute syntaxes.
// Perform any additional initialization that might be necessary before
// loading the configuration.
new ConcurrentHashMap<DN,
PasswordValidator<? extends PasswordValidatorCfg>>();
new ConcurrentHashMap<String,
MonitorProvider<? extends MonitorProviderCfg>>();
new CopyOnWriteArrayList<PersistentSearch>();
directoryServer.returnBindErrorMessages = false;
}
}
/**
* Bootstraps the Directory Server by initializing all the necessary
* structures that should be in place before the configuration may be read.
* This step must be completed before the server may be started or the
* configuration is loaded, but it will not be allowed while the server is
* running.
*
* @throws InitializationException If a problem occurs while attempting to
* bootstrap the server.
*/
public void bootstrapServer()
throws InitializationException
{
// First, make sure that the server isn't currently running. If it isn't,
// then make sure that no other thread will try to start or bootstrap the
// server before this thread is done.
synchronized (directoryServer)
{
if (isRunning)
{
throw new InitializationException(message);
}
isBootstrapped = false;
shuttingDown = false;
}
// Create the thread group that should be used for all Directory Server
// threads.
// Add a shutdown hook so that the server can be notified when the JVM
// starts shutting down.
shutdownHook = new DirectoryServerShutdownHook();
// Register this class as the default uncaught exception handler for the
// JVM. The uncaughtException method will be called if a thread dies
// because it did not properly handle an exception.
// Install default debug and error loggers for use until enough of the
// configuration has been read to allow the real loggers to be installed.
{
}
{
}
{
}
// Create the MBean server that we will use for JMX interaction.
// Perform all the bootstrapping that is shared with the client-side
// processing.
// Initialize the variables that will be used for connection tracking.
currentConnections = 0;
maxConnections = 0;
totalConnections = 0;
// Create the plugin config manager, but don't initialize it yet. This will
// make it possible to process internal operations before the plugins have
// been loaded.
pluginConfigManager = new PluginConfigManager();
// If we have gotten here, then the configuration should be properly
// bootstrapped.
synchronized (directoryServer)
{
isBootstrapped = true;
}
}
/**
* Performs a minimal set of JMX initialization. This may be used by the core
* Directory Server or by command-line tools.
*
* @throws InitializationException If a problem occurs while attempting to
* initialize the JMX subsystem.
*/
public static void initializeJMX()
throws InitializationException
{
try
{
// FIXME -- Should we use the plaform Mbean Server or
// should we use a private one ?
// directoryServer.mBeanServer =
// ManagementFactory.getPlatformMBeanServer();
}
catch (Exception e)
{
if (debugEnabled())
{
}
throw new InitializationException(message, e);
}
}
/**
* Instantiates the configuration handler and loads the Directory Server
* configuration.
*
* @param configClass The fully-qualified name of the Java class that will
* serve as the configuration handler for the Directory
* Server.
* @param configFile The path to the file that will hold either the entire
* server configuration or enough information to allow
* the server to access the configuration in some other
* repository.
*
* @throws InitializationException If a problem occurs while trying to
* initialize the config handler.
*/
throws InitializationException
{
try
{
}
catch (Exception e)
{
if (debugEnabled())
{
}
throw new InitializationException(message, e);
}
}
/**
* Instantiates the configuration handler and loads the Directory Server
* configuration.
*
* @throws InitializationException If a problem occurs while trying to
* initialize the config handler.
*/
public void initializeConfiguration()
throws InitializationException
{
// Make sure that administration framework definition classes are loaded.
{
}
// Load and instantiate the configuration handler class.
try
{
}
catch (Exception e)
{
if (debugEnabled())
{
}
e.getLocalizedMessage());
throw new InitializationException(message, e);
}
// Perform the handler-specific initialization.
try
{
false);
}
catch (InitializationException ie)
{
if (debugEnabled())
{
}
throw ie;
}
catch (Exception e)
{
if (debugEnabled())
{
}
e.getLocalizedMessage());
throw new InitializationException(message);
}
}
/**
* Retrieves the path to the configuration file used to initialize the
* Directory Server.
*
* @return The path to the configuration file used to initialize the
* Directory Server.
*/
public static String getConfigFile()
{
}
/**
* Starts up the Directory Server. It must have already been bootstrapped
* and cannot be running.
*
* @throws ConfigException If there is a problem with the Directory Server
* configuration that prevents a critical component
* from being instantiated.
*
* @throws InitializationException If some other problem occurs while
* attempting to initialize and start the
* Directory Server.
*/
public void startServer()
{
synchronized (directoryServer)
{
if (! isBootstrapped)
{
throw new InitializationException(message);
}
if (isRunning)
{
throw new InitializationException(message);
}
// Acquire an exclusive lock for the Directory Server process.
if (! serverLocked)
{
try
{
{
throw new InitializationException(message);
}
serverLocked = true;
}
catch (InitializationException ie)
{
throw ie;
}
catch (Exception e)
{
if (debugEnabled())
{
}
throw new InitializationException(message, e);
}
}
// Determine whether or not we should start the connection handlers.
boolean startConnectionHandlers =
// Initialize all the schema elements.
// Initialize the core Directory Server configuration.
coreConfigManager = new CoreConfigManager();
// Initialize the Directory Server crypto manager.
// Initialize the log rotation policies.
// Initialize the log retention policies.
// Initialize the server loggers.
loggerConfigManager = new LoggerConfigManager();
// Initialize the server alert handlers.
// Initialize the default entry cache. We have to have one before
// <CODE>initializeBackends()</CODE> method kicks in further down.
// Initialize the key manager provider.
// Initialize the trust manager provider.
// Initialize the certificate mapper.
// Initialize the identity mappers.
// Initialize the root DNs.
rootDNConfigManager = new RootDNConfigManager();
// Initialize the group manager.
// Initialize the access control handler.
// Initialize all the backends and their associated suffixes.
// A first set of workflows had been created in the registerBackend
// method. We now need to complete the workflow creation for the
// backends that were not registered through the registerBackend
// method (ie. cn=config and RootDSE).
// Check for and initialize user configured entry cache if any,
// if not stick with default entry cache initialized earlier.
// Reset the map as we can no longer guarantee offline state.
// Register the supported controls and supported features.
// Initialize all the extended operation handlers.
// Initialize all the SASL mechanism handlers.
// Initialize all the virtual attribute handlers.
// Initialize all the connection handlers.
{
}
// Initialize all the monitor providers.
monitorConfigManager = new MonitorConfigManager();
// Initialize all the password policy components.
// Load and initialize all the plugins, and then call the registered
// startup plugins.
// Initialize any synchronization providers that may be defined.
// Create and initialize the work queue.
if (! startupPluginResult.continueStartup())
{
throw new InitializationException(message);
}
{
new IdleTimeLimitThread().start();
}
// Create an object to synchronize ADS with the crypto manager.
new CryptoManagerSync();
// If we should write a copy of the config on successful startup, then do
// so now.
{
}
// Mark the current time as the start time and indicate that the server is
// now running.
isRunning = true;
{
}
{
}
// Force the root connection to be initialized.
// If a server.starting file exists, then remove it.
if (serverStartingFile.exists())
{
}
}
}
/**
* Registers a basic set of matching rules with the server that should always
* be available regardless of the server configuration and may be needed for
* configuration processing.
*/
private void bootstrapMatchingRules()
{
try
{
}
catch (Exception e)
{
if (debugEnabled())
{
}
}
try
{
}
catch (Exception e)
{
if (debugEnabled())
{
}
}
try
{
}
catch (Exception e)
{
if (debugEnabled())
{
}
}
try
{
}
catch (Exception e)
{
if (debugEnabled())
{
}
}
try
{
}
catch (Exception e)
{
if (debugEnabled())
{
}
}
try
{
}
catch (Exception e)
{
if (debugEnabled())
{
}
}
try
{
}
catch (Exception e)
{
if (debugEnabled())
{
}
}
try
{
}
catch (Exception e)
{
if (debugEnabled())
{
}
}
try
{
}
catch (Exception e)
{
if (debugEnabled())
{
}
}
try
{
}
catch (Exception e)
{
if (debugEnabled())
{
}
}
try
{
}
catch (Exception e)
{
if (debugEnabled())
{
}
}
try
{
}
catch (Exception e)
{
if (debugEnabled())
{
}
}
try
{
}
catch (Exception e)
{
if (debugEnabled())
{
}
}
try
{
}
catch (Exception e)
{
if (debugEnabled())
{
}
}
try
{
}
catch (Exception e)
{
if (debugEnabled())
{
}
}
try
{
}
catch (Exception e)
{
if (debugEnabled())
{
}
}
try
{
}
catch (Exception e)
{
if (debugEnabled())
{
}
}
try
{
}
catch (Exception e)
{
if (debugEnabled())
{
}
}
try
{
}
catch (Exception e)
{
if (debugEnabled())
{
}
}
try
{
}
catch (Exception e)
{
if (debugEnabled())
{
}
}
try
{
}
catch (Exception e)
{
if (debugEnabled())
{
}
}
try
{
}
catch (Exception e)
{
if (debugEnabled())
{
}
}
try
{
}
catch (Exception e)
{
if (debugEnabled())
{
}
}
}
/**
* Registers a basic set of attribute syntaxes with the server that should
* always be available regardless of the server configuration and may be
* needed for configuration processing.
*/
private void bootstrapAttributeSyntaxes()
{
try
{
registerAttributeSyntax(syntax, true);
}
catch (Exception e)
{
if (debugEnabled())
{
}
}
try
{
defaultBinarySyntax = new BinarySyntax();
}
catch (Exception e)
{
if (debugEnabled())
{
}
}
try
{
defaultBooleanSyntax = new BooleanSyntax();
}
catch (Exception e)
{
if (debugEnabled())
{
}
}
try
{
defaultStringSyntax = new DirectoryStringSyntax();
}
catch (Exception e)
{
if (debugEnabled())
{
}
}
try
{
defaultDNSyntax = new DistinguishedNameSyntax();
}
catch (Exception e)
{
if (debugEnabled())
{
}
}
try
{
registerAttributeSyntax(syntax, true);
}
catch (Exception e)
{
if (debugEnabled())
{
}
}
try
{
defaultIntegerSyntax = new IntegerSyntax();
}
catch (Exception e)
{
if (debugEnabled())
{
}
}
try
{
registerAttributeSyntax(syntax, true);
}
catch (Exception e)
{
if (debugEnabled())
{
}
}
try
{
registerAttributeSyntax(syntax, true);
}
catch (Exception e)
{
if (debugEnabled())
{
}
}
try
{
registerAttributeSyntax(syntax, true);
}
catch (Exception e)
{
if (debugEnabled())
{
}
}
try
{
registerAttributeSyntax(syntax, true);
}
catch (Exception e)
{
if (debugEnabled())
{
}
}
}
/**
* Retrieves the authenticated users manager for the Directory Server.
*
* @return The authenticated users manager for the Directory Server.
*/
public static AuthenticatedUsers getAuthenticatedUsers()
{
return directoryServer.authenticatedUsers;
}
/**
* Initializes the crypto manager for the Directory Server.
*
* @throws ConfigException If a configuration problem is identified while
* initializing the crypto manager.
*
* @throws InitializationException If a problem occurs while initializing
* the crypto manager that is not related
* to the server configuration.
*/
public void initializeCryptoManager()
{
}
/**
* Retrieves a reference to the Directory Server crypto manager.
*
* @return A reference to the Directory Server crypto manager.
*/
public static CryptoManager getCryptoManager()
{
return directoryServer.cryptoManager;
}
/**
* Indicates whether the Directory Server is configured with information about
* one or more mail servers and may therefore be used to send e-mail messages.
*
* @return {@code true} if the Directory Server is configured to be able to
* send e-mail messages, or {@code false} if not.
*/
public static boolean mailServerConfigured()
{
}
/**
* Specifies the set of mail server properties that should be used for SMTP
* communication.
*
* @param mailServerPropertySets A list of {@code Properties} objects that
* provide information that can be used to
* communicate with SMTP servers.
*/
{
}
/**
* Retrieves the sets of information about the mail servers configured for use
* by the Directory Server.
*
* @return The sets of information about the mail servers configured for use
* by the Directory Server.
*/
{
}
/**
* Initializes the set of alert handlers defined in the Directory Server.
*
* @throws ConfigException If there is a configuration problem with any of
* the alert handlers.
*
* @throws InitializationException If a problem occurs while initializing
* the alert handlers that is not related to
* the server configuration.
*/
private void initializeAlertHandlers()
{
}
/**
* Initializes the schema elements for the Directory Server, including the
* matching rules, attribute syntaxes, attribute types, and object classes.
*
* @throws ConfigException If there is a configuration problem with any of
* the schema elements.
*
* @throws InitializationException If a problem occurs while initializing
* the schema elements that is not related
* to the server configuration.
*/
public void initializeSchema()
{
// Create the schema configuration manager, and initialize the schema from
// the configuration.
schemaConfigManager = new SchemaConfigManager();
// With server schema in place set compressed schema.
compressedSchema = new DefaultCompressedSchema();
// At this point we have a problem, because none of the configuration is
// usable because it was all read before we had a schema (and therefore all
// of the attribute types and objectclasses are bogus and won't let us find
// anything). So we have to re-read the configuration so that we can
// continue the necessary startup process. In the process, we want to
// been registered with the old configuration (which will primarily be
// schema elements) so they can be re-registered with the new configuration.
try
{
}
catch (Exception e)
{
if (debugEnabled())
{
}
}
try
{
}
catch (InitializationException ie)
{
if (debugEnabled())
{
}
throw ie;
}
catch (Exception e)
{
if (debugEnabled())
{
}
e.getLocalizedMessage());
throw new InitializationException(message);
}
// Re-register all of the change listeners with the configuration.
{
try
{
{
}
}
catch (DirectoryException de)
{
// This should never happen, so we'll just re-throw it.
}
}
{
try
{
{
}
}
catch (DirectoryException de)
{
// This should never happen, so we'll just re-throw it.
}
}
{
try
{
{
}
}
catch (DirectoryException de)
{
// This should never happen, so we'll just re-throw it.
}
}
}
/**
* Retrieves the default compressed schema manager for the Directory Server.
*
* @return The default compressed schema manager for the Directory Server.
*/
public static CompressedSchema getDefaultCompressedSchema()
{
return directoryServer.compressedSchema;
}
/**
* Gets all of the add, delete, and change listeners from the provided
* configuration entry and all of its descendants and puts them in the
* appropriate lists.
*
* @param configEntry The configuration entry to be processed, along
* with all of its descendants.
* @param addListeners The set of add listeners mapped to the DN of the
* corresponding configuration entry.
* @param deleteListeners The set of delete listeners mapped to the DN of
* the corresponding configuration entry.
* @param changeListeners The set of change listeners mapped to the DN of
* the corresponding configuration entry.
*/
{
{
}
{
}
{
}
{
}
}
/**
* Retrieves the set of backend initialization listeners that have been
* registered with the Directory Server. The contents of the returned set
* must not be altered.
*
* @return The set of backend initialization listeners that have been
* registered with the Directory Server.
*/
public static Set<BackendInitializationListener>
{
}
/**
* Registers the provided backend initialization listener with the Directory
* Server.
*
* @param listener The backend initialization listener to register with the
* Directory Server.
*/
public static void registerBackendInitializationListener(
{
}
/**
* Deegisters the provided backend initialization listener with the Directory
* Server.
*
* @param listener The backend initialization listener to deregister with
* the Directory Server.
*/
public static void deregisterBackendInitializationListener(
{
}
/**
* Initializes the set of backends defined in the Directory Server.
*
* @throws ConfigException If there is a configuration problem with any of
* the backends.
*
* @throws InitializationException If a problem occurs while initializing
* the backends that is not related to the
* server configuration.
*/
private void initializeBackends()
{
backendConfigManager = new BackendConfigManager();
// Make sure to initialize the root DSE backend separately after all other
// backends.
try
{
}
catch (Exception e)
{
if (debugEnabled())
{
}
throw new InitializationException(message, e);
}
rootDSEBackend = new RootDSEBackend();
}
/**
* Deregisters a set of workflows each of which is identified with
* a baseDN.
*
* In the first implementation, workflows are stored in the default network
* group only.
*
* @param baseDNs the DNs of the workflows to deregister
*/
private static void deregisterWorkflows(
)
{
{
}
}
/**
* Deregisters one workflow with the appropriate network group.
*
* In the first implementation, workflows are stored in the default network
* group only.
*
* @param baseDN the DN of the workflow to deregister
*/
private static void deregisterWorkflow(
)
{
// Get the default network group and deregister all the workflows
// being configured for the backend (reminder: there is one worklfow
// per base DN configured in the backend).
}
/**
* Creates a set of workflows for a given backend. There are as many
* workflows as base DNs defined in the backend. Each workflow is
* registered with the appropriate network group.
*
* TODO implement the registration with the appropriate network group.
*
* @param backend the backend handled by the workflow
*
* @throws DirectoryException If the workflow ID for the provided
* workflow conflicts with the workflow
* ID of an existing workflow.
*/
public static void createAndRegisterWorkflows(
) throws DirectoryException
{
// Create a worklfow for each baseDN being configured
// in the backend and register the workflow with the network groups.
// In the automatic configuration mode, the workflow identifier is
// set to the backend ID.
{
}
}
/**
* Creates one workflow for a given base DN in a backend. The workflow
* is registered with the appropriate network group.
*
* TODO implement the registration with the appropriate network group.
*
* @param baseDN the base DN of the workflow to create
* @param backend the backend handled by the workflow
*
* @throws DirectoryException If the workflow ID for the provided
* workflow conflicts with the workflow
* ID of an existing workflow.
*/
public static void createAndRegisterWorkflow(
) throws DirectoryException
{
// Create a root workflow element to encapsulate the backend
// Create the worklfow for the base DN and register the workflow with
// the appropriate network groups.
}
/**
* Registers a workflow with the appropriate network groups.
*
* In the first implementation, the workflow is registered with the
* default network group only.
*
* TODO implement the registration with the appropriate network group.
*
* @param workflowImpl the workflow to register
*
* @throws DirectoryException If the workflow ID for the provided
* workflow conflicts with the workflow
* ID of an existing workflow in a
* network group.
*/
private static void registerWorkflowInNetworkGroups(
) throws DirectoryException
{
// Now for each network group that exposes the baseDN of the workflow
// create an instance of the workflow and register it with the network
// group.
// TODO jdemendi - we need the network group configuration to configure
// the workflows per network group.
}
/**
* Creates the workflows for the backends whose baseDNs were not registered
* with registerBaseDN method, namely config backend and RootDSE backend.
*
* @throws ConfigException If there is a configuration problem with any of
* the workflows.
*/
private void createAndRegisterRemainingWorkflows()
throws ConfigException
{
try
{
}
catch (DirectoryException de)
{
}
}
/**
* Initializes the Directory Server group manager.
*
* @throws ConfigException If there is a configuration problem with any of
* the group implementations.
*
* @throws InitializationException If a problem occurs while initializing
* the group manager that is not related to
* the server configuration.
*/
public void initializeGroupManager()
{
groupManager = new GroupManager();
// The configuration backend has already been registered by this point
// so we need to handle it explicitly.
}
/**
* Retrieves the Directory Server group manager.
*
* @return The Directory Server group manager.
*/
public static GroupManager getGroupManager()
{
return directoryServer.groupManager;
}
/**
* Initializes the set of supported controls for the Directory Server.
*
* @throws ConfigException If there is a configuration problem with the
* list of supported controls.
*
* @throws InitializationException If a problem occurs while initializing
* the set of supported controls that is not
* related to the server configuration.
*/
private void initializeSupportedControls()
{
}
/**
* Initializes the set of supported features for the Directory Server.
*
* @throws ConfigException If there is a configuration problem with the
* list of supported features.
*
* @throws InitializationException If a problem occurs while initializing
* the set of supported features that is not
* related to the server configuration.
*/
private void initializeSupportedFeatures()
{
}
/**
* Initializes the set of identity mappers for the Directory Server.
*
* @throws ConfigException If there is a configuration problem with any of
* the extended operation handlers.
*
* @throws InitializationException If a problem occurs while initializing
* the extended operation handlers that is
* not related to the server configuration.
*/
private void initializeIdentityMappers()
{
}
/**
* Initializes the set of extended operation handlers for the Directory
* Server.
*
* @throws ConfigException If there is a configuration problem with any of
* the extended operation handlers.
*
* @throws InitializationException If a problem occurs while initializing
* the extended operation handlers that is
* not related to the server configuration.
*/
private void initializeExtendedOperations()
{
}
/**
* Initializes the set of SASL mechanism handlers for the Directory Server.
*
* @throws ConfigException If there is a configuration problem with any of
* the SASL mechanism handlers.
*
* @throws InitializationException If a problem occurs while initializing
* the SASL mechanism handlers that is not
* related to the server configuration.
*/
private void initializeSASLMechanisms()
{
saslConfigManager = new SASLConfigManager();
}
/**
* Initializes the set of virtual attributes that should be defined in the
* Directory Server.
*
* @throws ConfigException If there is a configuration problem with any of
* the virtual attribute handlers.
*
* @throws InitializationException If a problem occurs while initializing
* the virtual attribute handlers that is
* not related to the server configuration.
*/
private void initializeVirtualAttributes()
{
}
/**
* Initializes the set of connection handlers that should be defined in the
* Directory Server.
*
* @throws ConfigException If there is a configuration problem with any of
* the connection handlers.
*
* @throws InitializationException If a problem occurs while initializing
* the connection handlers that is not
* related to the server configuration.
*/
private void initializeConnectionHandlers()
{
}
/**
* Initializes the set of password policy components for use by the Directory
* Server.
*
* @throws ConfigException If there is a configuration problem with any of
* the password policy components.
*
* @throws InitializationException If a problem occurs while initializing
* the password policy components that is
* not related to the server configuration.
*/
public void initializePasswordPolicyComponents()
{
// Initialize all the password storage schemes.
// Initialize all the password validators.
// Initialize all the password generators.
// Initialize the account status notification handlers.
// Initialize all the password policies.
}
/**
* Retrieves the operating system on which the Directory Server is running.
*
* @return The operating system on which the Directory Server is running.
*/
public static OperatingSystem getOperatingSystem()
{
return directoryServer.operatingSystem;
}
/**
* Retrieves the thread group that should be used by all threads associated
* with the Directory Server.
*
* @return The thread group that should be used by all threads associated
* with the Directory Server.
*/
public static ThreadGroup getDirectoryThreadGroup()
{
return directoryServer.directoryThreadGroup;
}
/**
* Retrieves a reference to the Directory Server configuration handler.
*
* @return A reference to the Directory Server configuration handler.
*/
public static ConfigHandler getConfigHandler()
{
return directoryServer.configHandler;
}
/**
* Initializes the set of plugins defined in the Directory Server.
*
* @throws ConfigException If there is a configuration problem with any of
* the Directory Server plugins.
*
* @throws InitializationException If a problem occurs while initializing
* the plugins that is not related to the
* server configuration.
*/
public void initializePlugins()
{
}
/**
* Initializes the set of plugins defined in the Directory Server. Only the
* specified types of plugins will be initialized.
*
* @param pluginTypes The set of plugin types for the plugins to
* initialize.
*
* @throws ConfigException If there is a configuration problem with any of
* the Directory Server plugins.
*
* @throws InitializationException If a problem occurs while initializing
* the plugins that is not related to the
* server configuration.
*/
{
pluginConfigManager = new PluginConfigManager();
}
/**
* Retrieves a reference to the Directory Server plugin configuration manager.
*
* @return A reference to the Directory Server plugin configuration manager.
*/
public static PluginConfigManager getPluginConfigManager()
{
return directoryServer.pluginConfigManager;
}
/**
* Retrieves the requested entry from the Directory Server configuration.
*
* @param entryDN The DN of the configuration entry to retrieve.
*
* @return The requested entry from the Directory Server configuration.
*
* @throws ConfigException If a problem occurs while trying to retrieve the
* requested entry.
*/
throws ConfigException
{
}
/**
* Retrieves the path to the root directory for this instance of the Directory
* Server.
*
* @return The path to the root directory for this instance of the Directory
* Server.
*/
public static String getServerRoot()
{
{
if (serverRoot != null)
{
return serverRoot.getAbsolutePath();
}
// We don't know where the server root is, so we'll have to assume it's
// the current working directory.
}
else
{
}
}
/**
* Retrieves the time that the Directory Server was started, in milliseconds
* since the epoch.
*
* @return The time that the Directory Server was started, in milliseconds
* since the epoch.
*/
public static long getStartTime()
{
return directoryServer.startUpTime;
}
/**
* Retrieves the time that the Directory Server was started, formatted in UTC.
*
* @return The time that the Directory Server was started, formatted in UTC.
*/
public static String getStartTimeUTC()
{
return directoryServer.startTimeUTC;
}
/**
* Retrieves a reference to the Directory Server schema.
*
* @return A reference to the Directory Server schema.
*/
{
return directoryServer.schema;
}
/**
* Replaces the Directory Server schema with the provided schema.
*
* @param schema The new schema to use for the Directory Server.
*/
{
}
/**
* Retrieves a list of modifications detailing any schema changes that may
* have been made with the server offline (e.g., by directly editing the
* schema configuration files). Note that this information will not be
* available until the server backends (and in particular, the schema backend)
* have been initialized.
*
* @return A list of modifications detailing any schema changes that may have
* been made with the server offline, or an empty list if no offline
* schema changes have been detected.
*/
{
return directoryServer.offlineSchemaChanges;
}
/**
* Specifies a list of modifications detailing any schema changes that may
* have been made with the server offline.
*
* @param offlineSchemaChanges A list of modifications detailing any schema
* changes that may have been made with the
* server offline. It must not be {@code null}.
*/
{
}
/**
* Retrieves the set of matching rules registered with the Directory Server.
* The mapping will be between the lowercase name or OID for each matching
* rule and the matching rule implementation. The same matching rule instance
* may be included multiple times with different keys.
*
* @return The set of matching rules registered with the Directory Server.
*/
{
}
/**
* Retrieves the set of encoded matching rules that have been defined in the
* Directory Server.
*
* @return The set of encoded matching rules that have been defined in the
* Directory Server.
*/
{
}
/**
* Retrieves the matching rule with the specified name or OID.
*
* @param lowerName The lowercase name or OID for the matching rule to
* retrieve.
*
* @return The requested matching rule, or <CODE>null</CODE> if no such
* matching rule has been defined in the server.
*/
{
}
/**
* Registers the provided matching rule with the Directory Server.
*
* @param matchingRule The matching rule to register with the server.
* @param overwriteExisting Indicates whether to overwrite an existing
* mapping if there are any conflicts (i.e.,
* another matching rule with the same OID or
* name).
*
* @throws DirectoryException If a conflict is encountered and the
* <CODE>overwriteExisting</CODE> flag is set to
* <CODE>false</CODE>
*/
boolean overwriteExisting)
throws DirectoryException
{
}
/**
* Deregisters the provided matching rule with the Directory Server.
*
* @param matchingRule The matching rule to deregister with the server.
*/
{
}
/**
* Retrieves the set of approximate matching rules registered with the
* Directory Server. The mapping will be between the lowercase name or OID
* for each approximate matching rule and the matching rule implementation.
* The same approximate matching rule instance may be included multiple times
* with different keys.
*
* @return The set of approximate matching rules registered with the
* Directory Server.
*/
{
}
/**
* Retrieves the approximate matching rule with the specified name or OID.
*
* @param lowerName The lowercase name or OID for the approximate matching
* rule to retrieve.
*
* @return The requested approximate matching rule, or <CODE>null</CODE> if
* no such matching rule has been defined in the server.
*/
public static ApproximateMatchingRule
{
}
/**
* Registers the provided approximate matching rule with the Directory
* Server.
*
* @param matchingRule The matching rule to register with the server.
* @param overwriteExisting Indicates whether to overwrite an existing
* mapping if there are any conflicts (i.e.,
* another matching rule with the same OID or
* name).
*
* @throws DirectoryException If a conflict is encountered and the
* <CODE>overwriteExisting</CODE> flag is set to
* <CODE>false</CODE>
*/
public static void registerApproximateMatchingRule(ApproximateMatchingRule
boolean overwriteExisting)
throws DirectoryException
{
}
/**
* Deregisters the provided approximate matching rule with the Directory
* Server.
*
* @param matchingRule The matching rule to deregister with the server.
*/
public static void deregisterApproximateMatchingRule(ApproximateMatchingRule
{
}
/**
* Retrieves the set of equality matching rules registered with the Directory
* Server. The mapping will be between the lowercase name or OID for each
* equality matching rule and the matching rule implementation. The same
* equality matching rule instance may be included multiple times with
* different keys.
*
* @return The set of equality matching rules registered with the Directory
* Server.
*/
{
}
/**
* Retrieves the equality matching rule with the specified name or OID.
*
* @param lowerName The lowercase name or OID for the equality matching rule
* to retrieve.
*
* @return The requested equality matching rule, or <CODE>null</CODE> if no
* such matching rule has been defined in the server.
*/
{
}
/**
* Registers the provided equality matching rule with the Directory Server.
*
* @param matchingRule The matching rule to register with the server.
* @param overwriteExisting Indicates whether to overwrite an existing
* mapping if there are any conflicts (i.e.,
* another matching rule with the same OID or
* name).
*
* @throws DirectoryException If a conflict is encountered and the
* <CODE>overwriteExisting</CODE> flag is set to
* <CODE>false</CODE>
*/
public static void registerEqualityMatchingRule(EqualityMatchingRule
boolean overwriteExisting)
throws DirectoryException
{
}
/**
* Deregisters the provided equality matching rule with the Directory Server.
*
* @param matchingRule The matching rule to deregister with the server.
*/
public static void deregisterEqualityMatchingRule(EqualityMatchingRule
{
}
/**
* Retrieves the set of ordering matching rules registered with the Directory
* Server. The mapping will be between the lowercase name or OID for each
* ordering matching rule and the matching rule implementation. The same
* ordering matching rule instance may be included multiple times with
* different keys.
*
* @return The set of ordering matching rules registered with the Directory
* Server.
*/
{
}
/**
* Retrieves the ordering matching rule with the specified name or OID.
*
* @param lowerName The lowercase name or OID for the ordering matching rule
* to retrieve.
*
* @return The requested ordering matching rule, or <CODE>null</CODE> if no
* such matching rule has been defined in the server.
*/
{
}
/**
* Registers the provided ordering matching rule with the Directory Server.
*
* @param matchingRule The matching rule to register with the server.
* @param overwriteExisting Indicates whether to overwrite an existing
* mapping if there are any conflicts (i.e.,
* another matching rule with the same OID or
* name).
*
* @throws DirectoryException If a conflict is encountered and the
* <CODE>overwriteExisting</CODE> flag is set to
* <CODE>false</CODE>
*/
public static void registerOrderingMatchingRule(OrderingMatchingRule
boolean overwriteExisting)
throws DirectoryException
{
}
/**
* Deregisters the provided ordering matching rule with the Directory Server.
*
* @param matchingRule The matching rule to deregister with the server.
*/
public static void deregisterOrderingMatchingRule(OrderingMatchingRule
{
}
/**
* Retrieves the set of substring matching rules registered with the Directory
* Server. The mapping will be between the lowercase name or OID for each
* substring matching rule and the matching rule implementation. The same
* substring matching rule instance may be included multiple times with
* different keys.
*
* @return The set of substring matching rules registered with the Directory
* Server.
*/
{
}
/**
* Retrieves the substring matching rule with the specified name or OID.
*
* @param lowerName The lowercase name or OID for the substring matching
* rule to retrieve.
*
* @return The requested substring matching rule, or <CODE>null</CODE> if no
* such matching rule has been defined in the server.
*/
{
}
/**
* Registers the provided substring matching rule with the Directory Server.
*
* @param matchingRule The matching rule to register with the server.
* @param overwriteExisting Indicates whether to overwrite an existing
* mapping if there are any conflicts (i.e.,
* another matching rule with the same OID or
* name).
*
* @throws DirectoryException If a conflict is encountered and the
* <CODE>overwriteExisting</CODE> flag is set to
* <CODE>false</CODE>
*/
public static void registerSubstringMatchingRule(SubstringMatchingRule
boolean overwriteExisting)
throws DirectoryException
{
}
/**
* Deregisters the provided substring matching rule with the Directory Server.
*
* @param matchingRule The matching rule to deregister with the server.
*/
public static void deregisterSubstringMatchingRule(SubstringMatchingRule
{
}
/**
* Retrieves the set of objectclasses defined in the Directory Server.
*
* @return The set of objectclasses defined in the Directory Server.
*/
{
}
/**
* Retrieves the set of encoded objectclasses that have been defined in the
* Directory Server.
*
* @return The set of encoded objectclasses that have been defined in the
* Directory Server.
*/
{
}
/**
* Retrieves the objectclass for the provided lowercase name or OID.
*
* @param lowerName The lowercase name or OID for the objectclass to
* retrieve.
*
* @return The requested objectclass, or <CODE>null</CODE> if there is no
* such objectclass defined in the server schema.
*/
{
}
/**
* Retrieves the objectclass for the provided lowercase name or OID. It can
* optionally return a generated "default" version if the requested
* objectclass is not defined in the schema.
*
* @param lowerName The lowercase name or OID for the objectclass to
* retrieve.
* @param returnDefault Indicates whether to generate a default version if
* the requested objectclass is not defined in the
* server schema.
*
* @return The objectclass type, or <CODE>null</CODE> if there is no
* objectclass with the specified name or OID defined in the server
* schema and a default class should not be returned.
*/
boolean returnDefault)
{
{
}
return oc;
}
/**
* Registers the provided objectclass with the Directory Server.
*
* @param objectClass The objectclass instance to register with the
* server.
* @param overwriteExisting Indicates whether to overwrite an existing
* mapping if there are any conflicts (i.e.,
* another objectclass with the same OID or
* name).
*
* @throws DirectoryException If a conflict is encountered and the
* <CODE>overwriteExisting</CODE> flag is set to
* <CODE>false</CODE>
*/
boolean overwriteExisting)
throws DirectoryException
{
}
/**
* Deregisters the provided objectclass with the Directory Server.
*
* @param objectClass The objectclass instance to deregister with the
* server.
*/
{
}
/**
* Retrieves the "top" objectClass, which should be the topmost objectclass in
* the inheritance chain for most other objectclasses. If no such objectclass
* could be found, then one will be constructed.
*
* @return The "top" objectClass.
*/
public static ObjectClass getTopObjectClass()
{
if (objectClass == null)
{
"( 2.5.6.0 NAME 'top' ABSTRACT MUST objectClass " +
"X-ORIGIN 'RFC 2256' )";
null);
}
return objectClass;
}
/**
* Causes the Directory Server to construct a new objectclass
* definition with the provided name and with no required or allowed
* attributes. This should only be used if there is no objectclass
* for the specified name. It will not register the created
* objectclass with the Directory Server.
*
* @param name
* The name to use for the objectclass, as provided by the
* user.
* @return The constructed objectclass definition.
*/
{
if (objectClass == null)
{
}
return objectClass;
}
/**
* Causes the Directory Server to construct a new auxiliary objectclass
* definition with the provided name and with no required or allowed
* attributes. This should only be used if there is no objectclass for the
* specified name. It will not register the created objectclass with the
* Directory Server.
*
* @param name The name to use for the objectclass, as provided by the user.
*
* @return The constructed objectclass definition.
*/
{
if (objectClass == null)
{
}
return objectClass;
}
/**
* Retrieves the set of attribute type definitions that have been
* defined in the Directory Server.
*
* @return The set of attribute type definitions that have been
* defined in the Directory Server.
*/
{
}
/**
* Retrieves the set of encoded attribute types that have been defined in the
* Directory Server.
*
* @return The set of encoded attribute types that have been defined in the
* Directory Server.
*/
{
}
/**
* Retrieves the attribute type for the provided lowercase name or OID.
*
* @param lowerName The lowercase attribute name or OID for the attribute
* type to retrieve.
*
* @return The requested attribute type, or <CODE>null</CODE> if there is no
* attribute with the specified type defined in the server schema.
*/
{
}
/**
* Retrieves the attribute type for the provided lowercase name or OID. It
* can optionally return a generated "default" version if the requested
* attribute type is not defined in the schema.
*
* @param lowerName The lowercase name or OID for the attribute type to
* retrieve.
* @param returnDefault Indicates whether to generate a default version if
* the requested attribute type is not defined in the
* server schema.
*
* @return The requested attribute type, or <CODE>null</CODE> if there is no
* attribute with the specified type defined in the server schema and
* a default type should not be returned.
*/
boolean returnDefault)
{
{
}
return type;
}
/**
* Registers the provided attribute type with the Directory Server.
*
* @param attributeType The attribute type to register with the
* Directory Server.
* @param overwriteExisting Indicates whether to overwrite an existing
* mapping if there are any conflicts (i.e.,
* another attribute type with the same OID or
* name).
*
* @throws DirectoryException If a conflict is encountered and the
* <CODE>overwriteExisting</CODE> flag is set to
* <CODE>false</CODE>
*/
boolean overwriteExisting)
throws DirectoryException
{
}
/**
* Deregisters the provided attribute type with the Directory Server.
*
* @param attributeType The attribute type to deregister with the Directory
* Server.
*/
{
}
/**
* Retrieves the attribute type for the "objectClass" attribute.
*
* @return The attribute type for the "objectClass" attribute.
*/
public static AttributeType getObjectClassAttributeType()
{
{
{
{
try
{
}
catch (Exception e)
{
if (debugEnabled())
{
}
}
}
"( 2.5.4.0 NAME 'objectClass' EQUALITY objectIdentifierMatch " +
"SYNTAX 1.3.6.1.4.1.1466.115.121.1.38 X-ORIGIN 'RFC 2256' )";
false, false, false, false);
try
{
}
catch (Exception e)
{
// This should never happen.
if (debugEnabled())
{
}
}
}
}
}
/**
* Causes the Directory Server to construct a new attribute type definition
* with the provided name and using the default attribute syntax. This should
* only be used if there is no real attribute type for the specified name.
*
* @param name The name to use for the attribute type, as provided by the
* user.
*
* @return The constructed attribute type definition.
*/
{
}
/**
* Causes the Directory Server to construct a new attribute type definition
* with the provided name and syntax. This should only be used if there is no
* real attribute type for the specified name.
*
* @param name The name to use for the attribute type, as provided by the
* user.
* @param syntax The syntax to use for the attribute type.
*
* @return The constructed attribute type definition.
*/
{
AttributeUsage.USER_APPLICATIONS, false, false,
false, false);
}
/**
* Retrieves the set of attribute syntaxes defined in the Directory Server.
*
* @return The set of attribute syntaxes defined in the Directory Server.
*/
{
}
/**
* Retrieves the set of encoded attribute syntaxes that have been defined in
* the Directory Server.
*
* @return The set of encoded attribute syntaxes that have been defined in
* the Directory Server.
*/
{
}
/**
* Retrieves the requested attribute syntax.
*
* @param oid The OID of the syntax to retrieve.
* @param allowDefault Indicates whether to return the default attribute
* syntax if the requested syntax is unknown.
*
* @return The requested attribute syntax, the default syntax if the
* requested syntax is unknown and the caller has indicated that the
* default is acceptable, or <CODE>null</CODE> otherwise.
*/
boolean allowDefault)
{
{
return getDefaultAttributeSyntax();
}
return syntax;
}
/**
* Registers the provided attribute syntax with the Directory Server.
*
* @param syntax The attribute syntax to register with the
* Directory Server.
* @param overwriteExisting Indicates whether to overwrite an existing
* mapping if there are any conflicts (i.e.,
* another attribute syntax with the same OID or
* name).
*
* @throws DirectoryException If a conflict is encountered and the
* <CODE>overwriteExisting</CODE> flag is set to
* <CODE>false</CODE>
*/
boolean overwriteExisting)
throws DirectoryException
{
}
/**
* Deregisters the provided attribute syntax with the Directory Server.
*
* @param syntax The attribute syntax to deregister with the Directory
* Server.
*/
{
}
/**
* Retrieves the default attribute syntax that should be used for attributes
* that are not defined in the server schema.
*
* @return The default attribute syntax that should be used for attributes
* that are not defined in the server schema.
*/
public static AttributeSyntax getDefaultAttributeSyntax()
{
return directoryServer.defaultSyntax;
}
/**
* Retrieves the default attribute syntax that should be used for attributes
* that are not defined in the server schema and are meant to store binary
* values.
*
* @return The default attribute syntax that should be used for attributes
* that are not defined in the server schema and are meant to store
* binary values.
*/
public static AttributeSyntax getDefaultBinarySyntax()
{
return directoryServer.defaultBinarySyntax;
}
/**
* Retrieves the default attribute syntax that should be used for attributes
* that are not defined in the server schema and are meant to store Boolean
* values.
*
* @return The default attribute syntax that should be used for attributes
* that are not defined in the server schema and are meant to store
* Boolean values.
*/
public static AttributeSyntax getDefaultBooleanSyntax()
{
return directoryServer.defaultBooleanSyntax;
}
/**
* Retrieves the default attribute syntax that should be used for attributes
* that are not defined in the server schema and are meant to store DN values.
*
* @return The default attribute syntax that should be used for attributes
* that are not defined in the server schema and are meant to store
* DN values.
*/
public static AttributeSyntax getDefaultDNSyntax()
{
return directoryServer.defaultDNSyntax;
}
/**
* Retrieves the default attribute syntax that should be used for attributes
* that are not defined in the server schema and are meant to store integer
* values.
*
* @return The default attribute syntax that should be used for attributes
* that are not defined in the server schema and are meant to store
* integer values.
*/
public static AttributeSyntax getDefaultIntegerSyntax()
{
return directoryServer.defaultIntegerSyntax;
}
/**
* Retrieves the default attribute syntax that should be used for attributes
* that are not defined in the server schema and are meant to store string
* values.
*
* @return The default attribute syntax that should be used for attributes
* that are not defined in the server schema and are meant to store
* string values.
*/
public static AttributeSyntax getDefaultStringSyntax()
{
return directoryServer.defaultStringSyntax;
}
/**
* Retrieves the set of matching rule uses defined in the Directory Server.
*
* @return The set of matching rule uses defined in the Directory Server.
*/
{
}
/**
* Retrieves the set of encoded matching rule uses that have been defined in
* the Directory Server.
*
* @return The set of encoded matching rule uses that have been defined in
* the Directory Server.
*/
{
}
/**
* Retrieves the matching rule use associated with the provided matching rule.
*
* @param matchingRule The matching rule for which to retrieve the matching
* rule use.
*
* @return The matching rule use for the provided matching rule, or
* <CODE>null</CODE> if none is defined.
*/
{
}
/**
* Registers the provided matching rule use with the Directory Server.
*
* @param matchingRuleUse The matching rule use to register with the
* server.
* @param overwriteExisting Indicates whether to overwrite an existing
* mapping if there are any conflicts (i.e.,
* another matching rule use with the same matching
* rule).
*
* @throws DirectoryException If a conflict is encountered and the
* <CODE>overwriteExisting</CODE> flag is set to
* <CODE>false</CODE>
*/
boolean overwriteExisting)
throws DirectoryException
{
}
/**
* Deregisters the provided matching rule use with the Directory Server.
*
* @param matchingRuleUse The matching rule use to deregister with the
* server.
*/
{
}
/**
* Retrieves the set of DIT content rules defined in the Directory Server.
*
* @return The set of DIT content rules defined in the Directory Server.
*/
{
}
/**
* Retrieves the set of encoded DIT content rules that have been defined in
* the Directory Server.
*
* @return The set of encoded DIT content rules that have been defined in the
* Directory Server.
*/
{
}
/**
* Retrieves the DIT content rule associated with the specified objectclass.
*
* @param objectClass The objectclass for which to retrieve the associated
* DIT content rule.
*
* @return The requested DIT content rule, or <CODE>null</CODE> if no such
* rule is defined in the schema.
*/
{
}
/**
* Registers the provided DIT content rule with the Directory Server.
*
* @param ditContentRule The DIT content rule to register with the
* server.
* @param overwriteExisting Indicates whether to overwrite an existing
* mapping if there are any conflicts (i.e.,
* another DIT content rule with the same
* structural objectclass).
*
* @throws DirectoryException If a conflict is encountered and the
* <CODE>overwriteExisting</CODE> flag is set to
* <CODE>false</CODE>
*/
boolean overwriteExisting)
throws DirectoryException
{
}
/**
* Deregisters the provided DIT content rule with the Directory Server.
*
* @param ditContentRule The DIT content rule to deregister with the server.
*/
{
}
/**
* Retrieves the set of DIT structure rules defined in the Directory Server.
*
* @return The set of DIT structure rules defined in the Directory Server.
*/
{
}
/**
* Retrieves the set of encoded DIT structure rules that have been defined in
* the Directory Server.
*
* @return The set of encoded DIT structure rules that have been defined in
* the Directory Server.
*/
{
}
/**
* Retrieves the DIT structure rule associated with the provided rule ID.
*
* @param ruleID The rule ID for which to retrieve the associated DIT
* structure rule.
*
* @return The requested DIT structure rule, or <CODE>null</CODE> if no such
* rule is defined.
*/
{
}
/**
* Retrieves the DIT structure rule associated with the provided name form.
*
* @param nameForm The name form for which to retrieve the associated DIT
* structure rule.
*
* @return The requested DIT structure rule, or <CODE>null</CODE> if no such
* rule is defined.
*/
{
}
/**
* Registers the provided DIT structure rule with the Directory Server.
*
* @param ditStructureRule The DIT structure rule to register with the
* server.
* @param overwriteExisting Indicates whether to overwrite an existing
* mapping if there are any conflicts (i.e.,
* another DIT structure rule with the same name
* form).
*
* @throws DirectoryException If a conflict is encountered and the
* <CODE>overwriteExisting</CODE> flag is set to
* <CODE>false</CODE>
*/
boolean overwriteExisting)
throws DirectoryException
{
}
/**
* Deregisters the provided DIT structure rule with the Directory Server.
*
* @param ditStructureRule The DIT structure rule to deregister with the
* server.
*/
public static void deregisterDITStructureRule(DITStructureRule
{
}
/**
* Retrieves the set of name forms defined in the Directory Server.
*
* @return The set of name forms defined in the Directory Server.
*/
{
}
/**
* Retrieves the set of encoded name forms that have been defined in the
* Directory Server.
*
* @return The set of encoded name forms that have been defined in the
* Directory Server.
*/
{
}
/**
* Retrieves the name form associated with the specified objectclass.
*
* @param objectClass The objectclass for which to retrieve the associated
* name form.
*
* @return The requested name form, or <CODE>null</CODE> if no such name form
* is defined in the schema.
*/
{
}
/**
* Retrieves the name form associated with the specified name or OID.
*
* @param lowerName The name or OID of the name form to retrieve, formatted
* in all lowercase characters.
*
* @return The requested name form, or <CODE>null</CODE> if no such name form
* is defined in the schema.
*/
{
}
/**
* Registers the provided name form with the Directory Server.
*
* @param nameForm The name form to register with the server.
* @param overwriteExisting Indicates whether to overwrite an existing
* mapping if there are any conflicts (i.e.,
* another name form with the same structural
* objectclass).
*
* @throws DirectoryException If a conflict is encountered and the
* <CODE>overwriteExisting</CODE> flag is set to
* <CODE>false</CODE>
*/
boolean overwriteExisting)
throws DirectoryException
{
}
/**
* Deregisters the provided name form with the Directory Server.
*
* @param nameForm The name form to deregister with the server.
*/
{
}
/**
* Retrieves the set of virtual attribute rules registered with the Directory
* Server.
*
* @return The set of virtual attribute rules registered with the Directory
* Server.
*/
{
return directoryServer.virtualAttributes;
}
/**
* Retrieves the set of virtual attribute rules registered with the Directory
* Server that are applicable to the provided entry.
*
* @param entry The entry for which to retrieve the applicable virtual
* attribute rules.
*
* @return The set of virtual attribute rules registered with the Directory
* Server that apply to the given entry. It may be an empty list if
* there are no applicable virtual attribute rules.
*/
{
new LinkedList<VirtualAttributeRule>();
{
{
}
}
return ruleList;
}
/**
* Registers the provided virtual attribute rule with the Directory Server.
*
* @param rule The virtual attribute rule to be registered.
*/
{
synchronized (directoryServer.virtualAttributes)
{
}
}
/**
* Deregisters the provided virtual attribute rule with the Directory Server.
*
* @param rule The virutal attribute rule to be deregistered.
*/
{
synchronized (directoryServer.virtualAttributes)
{
}
}
/**
* Replaces the specified virtual attribute rule in the set of virtual
* attributes registered with the Directory Server. If the old rule cannot
* be found in the list, then the set of registered virtual attributes is not
* updated.
*
* @param oldRule The existing rule that should be replaced with the new
* rule.
* @param newRule The new rule that should be used in place of the existing
* rule.
*
* @return {@code true} if the old rule was found and replaced with the new
* version, or {@code false} if it was not.
*/
{
synchronized (directoryServer.virtualAttributes)
{
if (pos >= 0)
{
return true;
}
else
{
return false;
}
}
}
/**
* Retrieves a reference to the JMX MBean server that is associated with the
* Directory Server.
*
* @return The JMX MBean server that is associated with the Directory Server.
*/
public static MBeanServer getJMXMBeanServer()
{
return directoryServer.mBeanServer;
}
/**
* Retrieves the set of JMX MBeans that are associated with the server.
*
* @return The set of JMX MBeans that are associated with the server.
*/
{
return directoryServer.mBeans;
}
/**
* Retrieves the JMX MBean associated with the specified entry in the
* Directory Server configuration.
*
* @param configEntryDN The DN of the configuration entry for which to
* retrieve the associated JMX MBean.
*
* @return The JMX MBean associated with the specified entry in the Directory
* Server configuration, or <CODE>null</CODE> if there is no MBean
* for the specified entry.
*/
{
}
/**
* Registers the provided invokable component with the Directory Server.
*
* @param component The invokable component to register.
*/
{
{
}
else
{
}
}
/**
* Deregisters the provided invokable component with the Directory Server.
*
* @param component The invokable component to deregister.
*/
{
{
}
}
/**
* Registers the provided alert generator with the Directory Server.
*
* @param alertGenerator The alert generator to register.
*/
{
{
}
else
{
}
}
/**
* Deregisters the provided alert generator with the Directory Server.
*
* @param alertGenerator The alert generator to deregister.
*/
{
{
}
}
/**
* Retrieves the set of alert handlers that have been registered with the
* Directory Server.
*
* @return The set of alert handlers that have been registered with the
* Directory Server.
*/
{
return directoryServer.alertHandlers;
}
/**
* Registers the provided alert handler with the Directory Server.
*
* @param alertHandler The alert handler to register.
*/
{
}
/**
* Deregisters the provided alert handler with the Directory Server.
*
* @param alertHandler The alert handler to deregister.
*/
{
}
/**
* Sends an alert notification with the provided information.
*
* @param generator The alert generator that created the alert.
* @param alertType The alert type name for this alert.
* @param alertMessage A message (possibly <CODE>null</CODE>) that can
*/
{
{
// If the Directory Server is still in the process of starting up, then
// create a JMX alert handler to use for this notification.
if (! directoryServer.isRunning)
{
try
{
}
catch (Exception e)
{
if (debugEnabled())
{
}
}
}
}
else
{
{
{
{
continue;
}
}
else
{
{
{
continue;
}
}
else
{
continue;
}
}
}
}
alertMessage != null ?
}
/**
* Retrieves the password storage scheme defined in the specified
* configuration entry.
*
* @param configEntryDN The DN of the configuration entry that defines the
* password storage scheme to retrieve.
*
* @return The requested password storage scheme, or {@code null} if no such
* scheme is defined.
*/
{
}
/**
* Retrieves the set of password storage schemes defined in the Directory
* Server, as a mapping between the all-lowercase scheme name and the
* corresponding implementation.
*
* @return The set of password storage schemes defined in the Directory
* Server.
*/
{
}
/**
* Retrieves the specified password storage scheme.
*
* @param lowerName The name of the password storage scheme to retrieve,
* formatted in all lowercase characters.
*
* @return The requested password storage scheme, or <CODE>null</CODE> if no
* such scheme is defined.
*/
{
}
/**
* Retrieves the set of authentication password storage schemes defined in the
* Directory Server, as a mapping between the scheme name and the
* corresponding implementation.
*
* @return The set of authentication password storage schemes defined in the
* Directory Server.
*/
{
}
/**
* Retrieves the specified authentication password storage scheme.
*
* @param name The case-sensitive name of the authentication password
* storage scheme to retrieve.
*
* @return The requested authentication password storage scheme, or
* <CODE>null</CODE> if no such scheme is defined.
*/
{
}
/**
* Registers the provided password storage scheme with the Directory Server.
* If an existing password storage scheme is registered with the same name,
* then it will be replaced with the provided scheme.
*
* @param configEntryDN The DN of the configuration entry that defines the
* password storage scheme.
* @param scheme The password storage scheme to register with the
* Directory Server.
*/
{
if (scheme.supportsAuthPasswordSyntax())
{
}
}
/**
* Deregisters the specified password storage scheme with the Directory
* Server. If no scheme is registered with the specified name, then no action
* will be taken.
*
* @param configEntryDN The DN of the configuration entry that defines the
* password storage scheme.
*/
{
{
if (scheme.supportsAuthPasswordSyntax())
{
}
}
}
/**
* Retrieves the set of password validators that have been registered for use
* with the Directory Server as a mapping between the DN of the associated
* validator configuration entry and the validator implementation.
*
* @return The set of password validators that have been registered for use
* with the Directory Server.
*/
public static
PasswordValidator<? extends PasswordValidatorCfg>>
{
return directoryServer.passwordValidators;
}
/**
* Retrieves the password validator registered with the provided configuration
* entry DN.
*
* @param configEntryDN The DN of the configuration entry for which to
* retrieve the associated password validator.
*
* @return The requested password validator, or <CODE>null</CODE> if no such
* validator is defined.
*/
public static PasswordValidator<? extends PasswordValidatorCfg>
{
}
/**
* Registers the provided password validator for use with the Directory
* Server.
*
* @param configEntryDN The DN of the configuration entry that defines the
* specified password validator.
* @param validator The password validator to register with the
* Directory Server.
*/
public static void
PasswordValidator<? extends PasswordValidatorCfg>
{
}
/**
* Deregisters the provided password validator for use with the Directory
* Server.
*
* @param configEntryDN The DN of the configuration entry that defines the
* password validator to deregister.
*/
{
}
/**
* Retrieves the set of account status notification handlers defined in the
* Directory Server, as a mapping between the DN of the configuration entry
* and the notification handler implementation.
*
* @return The set of account status notification handlers defined in the
* Directory Server.
*/
{
}
/**
* Retrieves the account status notification handler with the specified
* configuration entry DN.
*
* @param handlerDN The DN of the configuration entry associated with the
* account status notification handler to retrieve.
*
* @return The requested account status notification handler, or
* <CODE>null</CODE> if no such handler is defined in the server.
*/
public static AccountStatusNotificationHandler
{
}
/**
* Registers the provided account status notification handler with the
* Directory Server.
*
* @param handlerDN The DN of the configuration entry that defines the
* provided account status notification handler.
* @param handler The account status notification handler to register with
* the Directory Server.
*/
{
}
/**
* Deregisters the specified account status notification handler with the
* Directory Server.
*
* @param handlerDN The DN of the configuration entry for the account status
* notification handler to deregister.
*/
{
}
/**
* Retrieves the set of password generators that have been registered for use
* with the Directory Server as a mapping between the DN of the associated
* generator configuration entry and the generator implementation.
*
* @return The set of password generators that have been registered for use
* with the Directory Server.
*/
{
return directoryServer.passwordGenerators;
}
/**
* Retrieves the password generator registered with the provided configuration
* entry DN.
*
* @param configEntryDN The DN of the configuration entry for which to
* retrieve the associated password generator.
*
* @return The requested password generator, or <CODE>null</CODE> if no such
* generator is defined.
*/
{
}
/**
* Registers the provided password generator for use with the Directory
* Server.
*
* @param configEntryDN The DN of the configuration entry that defines the
* specified password generator.
* @param generator The password generator to register with the
* Directory Server.
*/
{
}
/**
* Deregisters the provided password generator for use with the Directory
* Server.
*
* @param configEntryDN The DN of the configuration entry that defines the
* password generator to deregister.
*/
{
}
/**
* Retrieves the set of password policies registered with the Directory
* Server. The references returned are to the actual password policy objects
* currently in use by the directory server and the referenced objects must
* not be modified.
*
* @return The set of password policies registered with the Directory Server.
*/
public static PasswordPolicy[] getPasswordPolicies()
{
// The password policy objects are returned in an array to prevent the
// caller from modifying the map structure.
{
}
return policies;
}
/**
* Retrieves the password policy registered for the provided configuration
* entry.
*
* @param configEntryDN The DN of the configuration entry for which to
* retrieve the associated password policy.
*
* @return The password policy registered for the provided configuration
* entry, or <CODE>null</CODE> if there is no such policy.
*/
{
}
/**
* Retrieves the password policy registered for the provided configuration
* entry.
*
* @param configEntryDN The DN of the configuration entry for which to
* retrieve the associated password policy.
*
* @return The password policy config registered for the provided
* configuration entry, or <CODE>null</CODE> if there is
* no such policy.
*/
{
}
/**
* Registers the provided password policy with the Directory Server. If a
* policy is already registered for the provided configuration entry DN, then
* it will be replaced.
*
* @param configEntryDN The DN of the configuration entry that defines the
* password policy.
* @param config The password policy config to register with the
* server.
*/
{
}
/**
* Deregisters the provided password policy with the Directory Server. If no
* such policy is registered, then no action will be taken.
*
* @param configEntryDN The DN of the configuration entry that defines the
* password policy to deregister.
*/
{
{
}
}
/**
* Retrieves the DN of the configuration entry for the default password policy
* for the Directory Server.
*
* @return The DN of the configuration entry for the default password policy
* for the Directory Server.
*/
public static DN getDefaultPasswordPolicyDN()
{
}
/**
* Specifies the DN of the configuration entry for the default password policy
* for the Directory Server. This routine does not check the registered
* password policies for the specified DN, since in the case of server
* initialization, the password policy entries will not yet have been loaded
* from the configuration backend.
*
* @param defaultPasswordPolicyDN The DN of the configuration entry for the
* default password policy for the Directory
* Server.
*/
{
}
/**
* Retrieves the default password policy for the Directory Server. This method
* is equivalent to invoking <CODE>getPasswordPolicy</CODE> on the DN returned
* from <CODE>DirectoryServer.getDefaultPasswordPolicyDN()</CODE>.
*
* @return The default password policy for the Directory Server.
*/
public static PasswordPolicy getDefaultPasswordPolicy()
{
: "Internal Error: no default password policy defined." ;
{
}
: "Internal Error: inconsistency between defaultPasswordPolicyConfig"
+ " cache and value in passwordPolicies map.";
}
/**
* Retrieves the log rotation policy registered for the provided configuration
* entry.
*
* @param configEntryDN The DN of the configuration entry for which to
* retrieve the associated rotation policy.
*
* @return The rotation policy registered for the provided configuration
* entry, or <CODE>null</CODE> if there is no such policy.
*/
{
}
/**
* Registers the provided log rotation policy with the Directory Server. If a
* policy is already registered for the provided configuration entry DN, then
* it will be replaced.
*
* @param configEntryDN The DN of the configuration entry that defines the
* password policy.
* @param policy The rotation policy to register with the server.
*/
{
}
/**
* Deregisters the provided log rotation policy with the Directory Server.
* If no such policy is registered, then no action will be taken.
*
* @param configEntryDN The DN of the configuration entry that defines the
* rotation policy to deregister.
*/
{
}
/**
* Retrieves the log retention policy registered for the provided
* configuration entry.
*
* @param configEntryDN The DN of the configuration entry for which to
* retrieve the associated retention policy.
*
* @return The retention policy registered for the provided configuration
* entry, or <CODE>null</CODE> if there is no such policy.
*/
{
}
/**
* Registers the provided log retention policy with the Directory Server.
* If a policy is already registered for the provided configuration entry DN,
* then it will be replaced.
*
* @param configEntryDN The DN of the configuration entry that defines the
* password policy.
* @param policy The retention policy to register with the server.
*/
{
}
/**
* Deregisters the provided log retention policy with the Directory Server.
* If no such policy is registered, then no action will be taken.
*
* @param configEntryDN The DN of the configuration entry that defines the
* retention policy to deregister.
*/
{
}
/**
* Retrieves the set of monitor providers that have been registered with the
* Directory Server, as a mapping between the monitor name (in all lowercase
* characters) and the monitor implementation.
*
* @return The set of monitor providers that have been registered with the
* Directory Server.
*/
public static ConcurrentHashMap<String,
MonitorProvider<? extends MonitorProviderCfg>>
{
return directoryServer.monitorProviders;
}
/**
* Retrieves the monitor provider with the specified name.
*
* @param lowerName The name of the monitor provider to retrieve, in all
* lowercase characters.
*
* @return The requested resource monitor, or <CODE>null</CODE> if none
* exists with the specified name.
*/
public static MonitorProvider<? extends MonitorProviderCfg>
{
}
/**
* Registers the provided monitor provider with the Directory Server. Note
* that if a monitor provider is already registered with the specified name,
* then it will be replaced with the provided implementation.
*
* @param monitorProvider The monitor provider to register with the
* Directory Server.
*/
public static void registerMonitorProvider(
MonitorProvider<? extends MonitorProviderCfg>
{
// Try to register this monitor provider with an appropriate JMX MBean.
try
{
{
}
else
{
}
}
catch (Exception e)
{
if (debugEnabled())
{
}
}
}
/**
* Deregisters the specified monitor provider from the Directory Server. If
* no such monitor provider is registered, no action will be taken.
*
* @param lowerName The name of the monitor provider to deregister, in all
* lowercase characters.
*/
{
// Try to deregister the monitor provider as an MBean.
{
try
{
{
}
}
catch (Exception e)
{
if (debugEnabled())
{
}
}
}
}
/**
* Retrieves the entry cache for the Directory Server.
*
* @return The entry cache for the Directory Server.
*/
public static EntryCache getEntryCache()
{
return directoryServer.entryCache;
}
/**
* Specifies the entry cache that should be used by the Directory Server.
* This should only be called by the entry cache configuration manager.
*
* @param entryCache The entry cache for the Directory Server.
*/
{
synchronized (directoryServer)
{
}
}
/**
* Retrieves the set of key manager providers registered with the Directory
* Server.
*
* @return The set of key manager providers registered with the Directory
* Server.
*/
{
return directoryServer.keyManagerProviders;
}
/**
* Retrieves the key manager provider registered with the provided entry DN.
*
* @param providerDN The DN with which the key manager provider is
* registered.
*
* @return The key manager provider registered with the provided entry DN, or
* {@code null} if there is no such key manager provider registered
* with the server.
*/
{
}
/**
* Registers the provided key manager provider with the Directory Server.
*
* @param providerDN The DN with which to register the key manager provider.
* @param provider The key manager provider to register with the server.
*/
{
}
/**
* Deregisters the specified key manager provider with the Directory Server.
*
* @param providerDN The DN with which the key manager provider is
* registered.
*/
{
}
/**
* Retrieves the set of trust manager providers registered with the Directory
* Server.
*
* @return The set of trust manager providers registered with the Directory
* Server.
*/
{
return directoryServer.trustManagerProviders;
}
/**
* Retrieves the trust manager provider registered with the provided entry DN.
*
* @param providerDN The DN with which the trust manager provider is
* registered.
*
* @return The trust manager provider registered with the provided entry DN,
* or {@code null} if there is no such trust manager provider
* registered with the server.
*/
{
}
/**
* Registers the provided trust manager provider with the Directory Server.
*
* @param providerDN The DN with which to register the trust manager
* provider.
* @param provider The trust manager provider to register with the server.
*/
{
}
/**
* Deregisters the specified trust manager provider with the Directory Server.
*
* @param providerDN The DN with which the trust manager provider is
* registered.
*/
{
}
/**
* Retrieves the set of certificate mappers registered with the Directory
* Server.
*
* @return The set of certificate mappers registered with the Directory
* Server.
*/
{
return directoryServer.certificateMappers;
}
/**
* Retrieves the certificate mapper registered with the provided entry DN.
*
* @param mapperDN The DN with which the certificate mapper is registered.
*
* @return The certificate mapper registered with the provided entry DN, or
* {@code null} if there is no such certificate mapper registered
* with the server.
*/
{
}
/**
* Registers the provided certificate mapper with the Directory Server.
*
* @param mapperDN The DN with which to register the certificate mapper.
* @param mapper The certificate mapper to register with the server.
*/
{
}
/**
* Deregisters the specified certificate mapper with the Directory Server.
*
* @param mapperDN The DN with which the certificate mapper is registered.
*/
{
}
/**
* Retrieves the set of privileges that should automatically be granted to
* root users when they authenticate.
*
* @return The set of privileges that should automatically be granted to root
* users when they authenticate.
*/
{
}
/**
* Retrieves the DNs for the root users configured in the Directory Server.
* Note that this set should only contain the actual DNs for the root users
* and not any alternate DNs. Also, the contents of the returned set must not
* be altered by the caller.
*
* @return The DNs for the root users configured in the Directory Server.
*/
{
return directoryServer.rootDNs;
}
/**
* Indicates whether the provided DN is the DN for one of the root users
* configured in the Directory Server.
*
* @param userDN The user DN for which to make the determination.
*
* @return <CODE>true</CODE> if the provided user DN is a Directory Server
* root DN, or <CODE>false</CODE> if not.
*/
{
}
/**
* Registers the provided root DN with the Directory Server.
*
* @param rootDN The root DN to register with the Directory Server.
*/
{
}
/**
* Deregisters the provided root DN with the Directory Server. This will have
* no effect if the provided DN is not registered as a root DN.
*
* @param rootDN The root DN to deregister.
*/
{
}
/**
* Retrieves the set of alternate bind DNs for root users, mapped between the
* alternate DN and the real DN. The contents of the returned map must not be
* altered by the caller.
*
* @return The set of alternate bind DNs for root users, mapped between the
* alternate DN and the real DN.
*/
{
return directoryServer.alternateRootBindDNs;
}
/**
* Retrieves the real entry DN for the root user with the provided alternate
* bind DN.
*
* @param alternateRootBindDN The alternate root bind DN for which to
* retrieve the real entry DN.
*
* @return The real entry DN for the root user with the provided alternate
* bind DN, or <CODE>null</CODE> if no such mapping has been defined.
*/
{
}
/**
* Registers an alternate root bind DN using the provided information.
*
* @param actualRootEntryDN The actual DN for the root user's entry.
* @param alternateRootBindDN The alternate DN that should be interpreted as
* if it were the provided actual root entry DN.
*
* @throws DirectoryException If the provided alternate bind DN is already
* in use for another root user.
*/
throws DirectoryException
{
if ((existingRootEntryDN != null) &&
{
}
}
/**
* Deregisters the provided alternate root bind DN from the server. This will
* have no effect if there was no mapping defined for the provided alternate
* root bind DN.
*
* @param alternateRootBindDN The alternate root bind DN to be deregistered.
*
* @return The actual root entry DN to which the provided alternate bind DN
* was mapped, or <CODE>null</CODE> if there was no mapping for the
* provided DN.
*/
{
}
/**
* Retrieves the result code that should be used when the Directory Server
* encounters an internal server error.
*
* @return The result code that should be used when the Directory Server
* encounters an internal server error.
*/
public static ResultCode getServerErrorResultCode()
{
return directoryServer.serverErrorResultCode;
}
/**
* Specifies the result code that should be used when the Directory Server
* encounters an internal server error.
*
* @param serverErrorResultCode The result code that should be used when the
* Directory Server encounters an internal
* server error.
*/
{
}
/**
* Indicates whether the Directory Server should automatically add missing RDN
* attributes to an entry whenever it is added.
*
* @return <CODE>true</CODE> if the Directory Server should automatically add
* missing RDN attributes to an entry, or <CODE>false</CODE> if it
* should return an error to the client.
*/
public static boolean addMissingRDNAttributes()
{
}
/**
* Specifies whether the Directory Server should automatically add missing RDN
* attributes to an entry whenever it is added.
*
* @param addMissingRDNAttributes Specifies whether the Directory Server
* should automatically add missing RDN
* attributes to an entry whenever it is
* added.
*/
public static void setAddMissingRDNAttributes(boolean addMissingRDNAttributes)
{
}
/**
* Indicates whether to be more flexible in the set of characters allowed for
* attribute names. The standard requires that only ASCII alphabetic letters,
* numeric digits, and hyphens be allowed, and that the name start with a
* letter. If attribute name exceptions are enabled, then underscores will
* also be allowed, and the name will be allowed to start with a digit.
*
* @return <CODE>true</CODE> if the server should use a more flexible
* syntax for attribute names, or <CODE>false</CODE> if not.
*/
public static boolean allowAttributeNameExceptions()
{
}
/**
* Specifies whether to be more flexible in the set of characters allowed for
* attribute names.
*
* @param allowAttributeNameExceptions Specifies whether to be more flexible
* in the set of characters allowed for
* attribute names.
*/
public static void setAllowAttributeNameExceptions(
boolean allowAttributeNameExceptions)
{
}
/**
* Indicates whether the Directory Server should perform schema checking.
*
* @return <CODE>true</CODE> if the Directory Server should perform schema
* checking, or <CODE>false</CODE> if not.
*/
public static boolean checkSchema()
{
return directoryServer.checkSchema;
}
/**
* Specifies whether the Directory Server should perform schema checking.
*
* @param checkSchema Specifies whether the Directory Server should perform
* schema checking.
*/
public static void setCheckSchema(boolean checkSchema)
{
}
/**
* Retrieves the policy that should be used regarding enforcement of a single
* structural objectclass per entry.
*
* @return The policy that should be used regarding enforcement of a single
* structural objectclass per entry.
*/
public static AcceptRejectWarn getSingleStructuralObjectClassPolicy()
{
}
/**
* Specifies the policy that should be used regarding enforcement of a single
* structural objectclass per entry.
*
* @param singleStructuralClassPolicy The policy that should be used
* regarding enforcement of a single
* structural objectclass per entry.
*/
public static void setSingleStructuralObjectClassPolicy(
{
}
/**
* Retrieves the policy that should be used when an attribute value is found
* that is not valid according to the associated attribute syntax.
*
* @return The policy that should be used when an attribute value is found
* that is not valid according to the associated attribute syntax.
*/
public static AcceptRejectWarn getSyntaxEnforcementPolicy()
{
}
/**
* Retrieves the policy that should be used when an attribute value is found
* that is not valid according to the associated attribute syntax.
*
* @param syntaxEnforcementPolicy The policy that should be used when an
* attribute value is found that is not valid
* according to the associated attribute
* syntax.
*/
public static void setSyntaxEnforcementPolicy(
{
}
/**
* Indicates whether the Directory Server should send a response to an
* operation that has been abandoned. Sending such a response is technically
* a violation of the LDAP protocol specification, but not doing so in that
* case can cause problems with clients that are expecting a response and may
* hang until they get one.
*
* @return <CODE>true</CODE> if the Directory Server should send a response
* to an operation that has been abandoned, or <CODE>false</CODE> if
* not.
*/
public static boolean notifyAbandonedOperations()
{
}
/**
* Specifies whether the Directory Server should send a response to an
* operation that has been abandoned. Sending such a response is technically
* a violation of the LDAP protocol specification, but not doing so in that
* case can cause problems with clients that are expecting a response and may
* hang until they get one.
*
* @param notifyAbandonedOperations Indicates whether the Directory Server
* should send a response to an operation
* that has been abandoned.
*/
public static void setNotifyAbandonedOperations(
boolean notifyAbandonedOperations)
{
}
/**
* Retrieves the set of backends that have been registered with the Directory
* Server, as a mapping between the backend ID and the corresponding backend.
*
* @return The set of backends that have been registered with the Directory
* Server.
*/
{
return directoryServer.backends;
}
/**
* Retrieves the backend with the specified backend ID.
*
* @param backendID The backend ID of the backend to retrieve.
*
* @return The backend with the specified backend ID, or {@code null} if
* there is none.
*/
{
}
/**
* Indicates whether the Directory Server has a backend with the specified
* backend ID.
*
* @param backendID The backend ID for which to make the determination.
*
* @return {@code true} if the Directory Server has a backend with the
* specified backend ID, or {@code false} if not.
*/
{
}
/**
* Registers the provided backend with the Directory Server. Note that this
* will not register the set of configured suffixes with the server, as that
* must be done by the backend itself.
*
* @param backend The backend to register with the server. Neither the
* backend nor its backend ID may be null.
*
* @throws DirectoryException If the backend ID for the provided backend
* conflicts with the backend ID of an existing
* backend.
*/
throws DirectoryException
{
synchronized (directoryServer)
{
{
}
else
{
{
}
{
}
}
}
}
/**
* Deregisters the provided backend with the Directory Server. Note that this
* will not deregister the set of configured suffixes with the server, as that
* must be done by the backend itself.
*
* @param backend The backend to deregister with the server. It must not be
* {@code null}.
*/
{
synchronized (directoryServer)
{
// Don't need anymore the local backend workflow element
{
}
}
}
/**
* This method returns a map that contains a unique offline state id,
* such as checksum, for every server backend that has registered one.
*
* @return <CODE>Map</CODE> backend to checksum map for offline state.
*/
}
/**
* This method allows any server backend to register its unique offline
* state, such as checksum, in a global map other server components can
* access to determine if any changes were made to given backend while
* offline.
*
* @param backend As returned by <CODE>getBackendID()</CODE> method.
*
* @param id Unique offline state identifier such as checksum.
*/
// Zero means failed checksum so just skip it.
if (id != 0) {
}
}
/**
* Retrieves the entire set of base DNs registered with the Directory Server,
* mapped from the base DN to the backend responsible for that base DN. The
* same backend may be present multiple times, mapped from different base DNs.
*
* @return The entire set of base DNs registered with the Directory Server.
*/
{
}
/**
* Retrieves the backend with the specified base DN.
*
* @param baseDN The DN that is registered as one of the base DNs for the
* backend to retrieve.
*
* @return The backend with the specified base DN, or {@code null} if there
* is no backend registered with the specified base DN.
*/
{
}
/**
* Retrieves the backend that should be used to handle operations on the
* specified entry.
*
* @param entryDN The DN of the entry for which to retrieve the
* corresponding backend.
*
* @return The backend that should be used to handle operations on the
* specified entry, or {@code null} if no appropriate backend is
* registered with the server.
*/
{
{
return directoryServer.rootDSEBackend;
}
while (b == null)
{
{
return null;
}
}
return b;
}
/**
* Obtains a copy of the server's base DN registry. The copy can be used
* to test registration/deregistration of base DNs but cannot be used to
* modify the backends. To modify the server's live base DN to backend
* mappings use {@link #registerBaseDN(DN, Backend, boolean)} and
* {@link #deregisterBaseDN(DN)}.
*
* @return copy of the base DN regsitry
*/
public static BaseDnRegistry copyBaseDnRegistry()
{
}
/**
* Registers the provided base DN with the server.
*
* @param baseDN The base DN to register with the server. It must not be
* {@code null}.
* @param backend The backend responsible for the provided base DN. It
* must not be {@code null}.
* @param isPrivate Indicates whether the base DN should be considered a
* private base DN. If the provided base DN is a naming
* context, then this controls whether it is public or
* private.
*
* @throws DirectoryException If a problem occurs while attempting to
* register the provided base DN.
*/
boolean isPrivate)
throws DirectoryException
{
synchronized (directoryServer)
{
// Since we've committed the changes we need to log any issues
// that this registration has caused
}
}
// Now create a workflow for the registered baseDN and register
// the workflow with the network groups, but don't register the
// workflow if the backend happens to be the configuration backend
// because it's too soon.
{
}
}
}
/**
* Deregisters the provided base DN with the server.
*
* @param baseDN The base DN to deregister with the server. It must not
* be {@code null}.
*
* @throws DirectoryException If a problem occurs while attempting to
* deregister the provided base DN.
*/
throws DirectoryException
{
synchronized(directoryServer) {
// Since we've committed the changes we need to log any issues
// that this registration has caused
}
}
// Now deregister the workflow that was associated with the base DN.
}
}
/**
* Retrieves the set of public naming contexts defined in the Directory
* Server, mapped from the naming context DN to the corresponding backend.
*
* @return The set of public naming contexts defined in the Directory Server.
*/
{
}
/**
* Retrieves the set of private naming contexts defined in the Directory
* Server, mapped from the naming context DN to the corresponding backend.
*
* @return The set of private naming contexts defined in the Directory
* Server.
*/
{
}
/**
* Indicates whether the specified DN is one of the Directory Server naming
* contexts.
*
* @param dn The DN for which to make the determination.
*
* @return {@code true} if the specified DN is a naming context for the
* Directory Server, or {@code false} if it is not.
*/
{
}
/**
* Retrieves the root DSE entry for the Directory Server.
*
* @return The root DSE entry for the Directory Server.
*/
public static Entry getRootDSE()
{
}
/**
* Retrieves the root DSE backend for the Directory Server.
*
* @return The root DSE backend for the Directory Server.
*/
public static RootDSEBackend getRootDSEBackend()
{
return directoryServer.rootDSEBackend;
}
/**
* Retrieves the DN of the entry containing the server schema definitions.
*
* @return The DN of the entry containing the server schema definitions, or
* <CODE>null</CODE> if none has been defined (e.g., if no schema
* backend has been configured).
*/
public static DN getSchemaDN()
{
return directoryServer.schemaDN;
}
/**
* Specifies the DN of the entry containing the server schema definitions.
*
* @param schemaDN The DN of the entry containing the server schema
* definitions.
*/
{
}
/**
* Retrieves the entry with the requested DN. It will first determine which
* backend should be used for this DN and will then use that backend to
* retrieve the entry. The caller must already hold the appropriate lock on
* the specified entry.
*
* @param entryDN The DN of the entry to retrieve.
*
* @return The requested entry, or <CODE>null</CODE> if it does not exist.
*
* @throws DirectoryException If a problem occurs while attempting to
* retrieve the entry.
*/
throws DirectoryException
{
// If the entry is the root DSE, then get and return that.
{
}
// Figure out which backend should be used for the entry. If it isn't
// appropriate for any backend, then return null.
{
return null;
}
// Retrieve the requested entry from the backend.
}
/**
* Indicates whether the specified entry exists in the Directory Server. The
* caller is not required to hold any locks when invoking this method.
*
* @param entryDN The DN of the entry for which to make the determination.
*
* @return <CODE>true</CODE> if the specified entry exists in one of the
* backends, or <CODE>false</CODE> if it does not.
*
* @throws DirectoryException If a problem occurs while attempting to
* make the determination.
*/
throws DirectoryException
{
// If the entry is the root DSE, then it will always exist.
{
return true;
}
// Figure out which backend should be used for the entry. If it isn't
// appropriate for any backend, then return false.
{
return false;
}
// Ask the appropriate backend if the entry exists.
}
/**
* Retrieves the set of supported controls registered with the Directory
* Server.
*
* @return The set of supported controls registered with the Directory
* Server.
*/
{
return directoryServer.supportedControls;
}
/**
* Indicates whether the specified OID is registered with the Directory Server
* as a supported control.
*
* @param controlOID The OID of the control for which to make the
* determination.
*
* @return <CODE>true</CODE> if the specified OID is registered with the
* server as a supported control, or <CODE>false</CODE> if not.
*/
{
}
/**
* Registers the provided OID as a supported control for the Directory Server.
* This will have no effect if the specified control OID is already present in
* the list of supported controls.
*
* @param controlOID The OID of the control to register as a supported
* control.
*/
{
synchronized (directoryServer.supportedControls)
{
}
}
/**
* Deregisters the provided OID as a supported control for the Directory
* Server. This will have no effect if the specified control OID is not
* present in the list of supported controls.
*
* @param controlOID The OID of the control to deregister as a supported
* control.
*/
{
synchronized (directoryServer.supportedControls)
{
}
}
/**
* Retrieves the set of supported features registered with the Directory
* Server.
*
* @return The set of supported features registered with the Directory
* Server.
*/
{
return directoryServer.supportedFeatures;
}
/**
* Indicates whether the specified OID is registered with the Directory Server
* as a supported feature.
*
* @param featureOID The OID of the feature for which to make the
* determination.
*
* @return <CODE>true</CODE> if the specified OID is registered with the
* server as a supported feature, or <CODE>false</CODE> if not.
*/
{
}
/**
* Registers the provided OID as a supported feature for the Directory Server.
* This will have no effect if the specified feature OID is already present in
* the list of supported features.
*
* @param featureOID The OID of the feature to register as a supported
* feature.
*/
{
synchronized (directoryServer.supportedFeatures)
{
}
}
/**
* Deregisters the provided OID as a supported feature for the Directory
* Server. This will have no effect if the specified feature OID is not
* present in the list of supported features.
*
* @param featureOID The OID of the feature to deregister as a supported
* feature.
*/
{
synchronized (directoryServer.supportedFeatures)
{
}
}
/**
* Retrieves the set of extended operations that may be processed by the
* Directory Server.
*
* @return The set of extended operations that may be processed by the
* Directory Server.
*/
{
}
/**
* Retrieves the handler for the extended operation for the provided OID.
*
* @param oid The OID of the extended operation to retrieve.
*
* @return The handler for the specified extended operation, or
* <CODE>null</CODE> if there is none.
*/
{
}
/**
* Registers the provided extended operation handler with the Directory
* Server.
*
* @param oid The OID for the extended operation to register.
* @param handler The extended operation handler to register with the
* Directory Server.
*/
{
}
/**
* Deregisters the provided extended operation handler with the Directory
* Server.
*
* @param oid The OID for the extended operation to deregister.
*/
{
}
/**
* Retrieves the set of SASL mechanisms that are supported by the Directory
* Server.
*
* @return The set of SASL mechanisms that are supported by the Directory
* Server.
*/
{
return directoryServer.saslMechanismHandlers;
}
/**
* Retrieves the handler for the specified SASL mechanism.
*
* @param name The name of the SASL mechanism to retrieve.
*
* @return The handler for the specified SASL mechanism, or <CODE>null</CODE>
* if there is none.
*/
{
}
/**
* Registers the provided SASL mechanism handler with the Directory Server.
*
* @param name The name of the SASL mechanism to be registered.
* @param handler The SASL mechanism handler to register with the Directory
* Server.
*/
{
// FIXME -- Should we force this name to be lowercase? If so, then will
// that cause the lower name to be used in the root DSE?
}
/**
* Deregisters the provided SASL mechanism handler with the Directory Server.
*
* @param name The name of the SASL mechanism to be deregistered.
*/
{
// FIXME -- Should we force this name to be lowercase?
}
/**
* Retrieves the set of identity mappers defined in the Directory Server
* configuration, as a mapping between the DN of the configuration entry and
* the identity mapper.
*
* @return The set of identity mappers defined in the Directory Server
* configuration.
*/
{
return directoryServer.identityMappers;
}
/**
* Retrieves the Directory Server identity mapper whose configuration resides
* in the specified configuration entry.
*
* @param configEntryDN The DN of the configuration entry for the identity
* mapper to retrieve.
*
* @return The requested identity mapper, or <CODE>null</CODE> if the
* provided entry DN is not associated with an active identity
* mapper.
*/
{
}
/**
* Registers the provided identity mapper for use with the Directory Server.
*
* @param configEntryDN The DN of the configuration entry in which the
* identity mapper definition resides.
* @param identityMapper The identity mapper to be registered.
*/
{
}
/**
* Deregisters the provided identity mapper for use with the Directory Server.
*
* @param configEntryDN The DN of the configuration entry in which the
* identity mapper definition resides.
*/
{
}
/**
* Retrieves the DN of the configuration entry for the identity mapper that
* should be used in conjunction with proxied authorization V2 controls.
*
* @return The DN of the configuration entry for the identity mapper that
* should be used in conjunction with proxied authorization V2
* controls, or <CODE>null</CODE> if none is defined.
*/
public static DN getProxiedAuthorizationIdentityMapperDN()
{
}
/**
* Specifies the DN of the configuration entry for the identity mapper that
* should be used in conjunction with proxied authorization V2 controls.
*
* @param proxiedAuthorizationIdentityMapperDN The DN of the configuration
* entry for the identity mapper
* that should be used in
* conjunction with proxied
* authorization V2 controls.
*/
public static void setProxiedAuthorizationIdentityMapperDN(
{
}
/**
* Retrieves the identity mapper that should be used to resolve authorization
* IDs contained in proxied authorization V2 controls.
*
* @return The identity mapper that should be used to resolve authorization
* IDs contained in proxied authorization V2 controls, or
* <CODE>null</CODE> if none is defined.
*/
public static IdentityMapper getProxiedAuthorizationIdentityMapper()
{
{
return null;
}
}
/**
* Retrieves the set of connection handlers configured in the Directory
* Server. The returned list must not be altered.
*
* @return The set of connection handlers configured in the Directory Server.
*/
{
return directoryServer.connectionHandlers;
}
/**
* Registers the provided connection handler with the Directory Server.
*
* @param handler The connection handler to register with the Directory
* Server.
*/
public static void registerConnectionHandler(
ConnectionHandler<? extends ConnectionHandlerCfg>
{
synchronized (directoryServer.connectionHandlers)
{
}
}
/**
* Deregisters the provided connection handler with the Directory Server.
*
* @param handler The connection handler to deregister with the Directory
* Server.
*/
{
synchronized (directoryServer.connectionHandlers)
{
{
}
}
}
/**
* Starts the connection handlers defined in the Directory Server
* Configuration.
*
* @throws ConfigException If there are more than one connection handlers
* using the same host port or no connection handler
* are enabled or we could not bind to any of the
* listeners.
*/
private void startConnectionHandlers() throws ConfigException
{
// Check that the port specified in the connection handlers is
// available.
for (ConnectionHandler<?> c : connectionHandlers)
{
{
{
// The port was already specified: this is a configuration error,
// log a message.
}
else
{
}
}
}
{
}
// If there are no connection handlers log a message.
if (connectionHandlers.isEmpty())
{
}
// At this point, we should be ready to go. Start all the connection
// handlers.
for (ConnectionHandler c : connectionHandlers)
{
c.start();
}
}
/**
* Retrieves a reference to the Directory Server work queue.
*
* @return A reference to the Directory Server work queue.
*/
public static WorkQueue getWorkQueue()
{
return directoryServer.workQueue;
}
/**
* Adds the provided operation to the work queue so that it will be processed
* by one of the worker threads.
*
* @param operation The operation to be added to the work queue.
*
* @throws DirectoryException If a problem prevents the operation from being
* added to the queue (e.g., the queue is full).
*/
throws DirectoryException
{
// See if a bind is already in progress on the associated connection. If so
// then reject the operation.
if (clientConnection.bindInProgress() &&
{
}
//Reject or accept the unauthenticated requests based on the configuration
// settings.
{
switch(operation.getOperationType())
{
case ADD:
case COMPARE:
case DELETE:
case SEARCH:
case MODIFY:
case MODIFY_DN:
{
message);
}
else
{
message);
}
case EXTENDED:
if (!((requestOID != null) &&
{
{
message);
}
else
{
message);
}
}
break;
}
}
// If the associated user is required to change their password before
// continuing, then make sure the associated operation is one that could
// result in the password being changed. If not, then reject it.
{
switch (operation.getOperationType())
{
case ADD:
case COMPARE:
case DELETE:
case MODIFY_DN:
case SEARCH:
// See if the request included the password policy request control.
// If it did, then add a corresponding response control.
{
{
break;
}
}
throw new DirectoryException(
case EXTENDED:
// We will only allow the password modify and StartTLS extended
// operations.
if ((requestOID == null) ||
{
// See if the request included the password policy request control.
// If it did, then add a corresponding response control.
{
{
break;
}
}
message);
}
break;
// Bind, unbind, and abandon will always be allowed.
// Modify may or may not be allowed, but we'll leave that
// determination up to the modify operation itself.
}
}
}
/**
* Retrieves the set of change notification listeners registered with the
* Directory Server.
*
* @return The set of change notification listeners registered with the
* Directory Server.
*/
public static CopyOnWriteArrayList<ChangeNotificationListener>
{
}
/**
* Registers the provided change notification listener with the Directory
* Server so that it will be notified of any add, delete, modify, or modify DN
* operations that are performed.
*
* @param changeListener The change notification listener to register with
* the Directory Server.
*/
public static void registerChangeNotificationListener(
{
}
/**
* Deregisters the provided change notification listener with the Directory
* Server so that it will no longer be notified of any add, delete, modify, or
* modify DN operations that are performed.
*
* @param changeListener The change notification listener to deregister with
* the Directory Server.
*/
public static void deregisterChangeNotificationListener(
{
}
/**
* Retrieves the set of persistent searches registered with the Directory
* Server.
*
* @return The set of persistent searches registered with the Directory
* Server.
*/
{
return directoryServer.persistentSearches;
}
/**
* Registers the provided persistent search operation with the Directory
* Server so that it will be notified of any add, delete, modify, or modify DN
* operations that are performed.
*
* @param persistentSearch The persistent search operation to register with
* the Directory Server.
*/
{
}
/**
* Deregisters the provided persistent search operation with the Directory
* Server so that it will no longer be notified of any add, delete, modify, or
* modify DN operations that are performed.
*
* @param persistentSearch The persistent search operation to deregister
* with the Directory Server.
*/
public static void deregisterPersistentSearch(PersistentSearch
{
}
/**
* Retrieves the set of synchronization providers that have been registered
* with the Directory Server.
*
* @return The set of synchronization providers that have been registered
* with the Directory Server.
*/
public static
{
}
/**
* Registers the provided synchronization provider with the Directory Server.
*
* @param provider The synchronization provider to register.
*/
public static void registerSynchronizationProvider(
{
}
/**
* Deregisters the provided synchronization provider with the Directory
* Server.
*
* @param provider The synchronization provider to deregister.
*/
public static void deregisterSynchronizationProvider(SynchronizationProvider
{
}
/**
* Retrieves a set containing the names of the allowed tasks that may be
* invoked in the server.
*
* @return A set containing the names of the allowed tasks that may be
* invoked in the server.
*/
{
return directoryServer.allowedTasks;
}
/**
* Specifies the set of allowed tasks that may be invoked in the server.
*
* @param allowedTasks A set containing the names of the allowed tasks that
* may be invoked in the server.
*/
{
}
/**
* Retrieves the set of privileges that have been disabled.
*
* @return The set of privileges that have been disabled.
*/
{
return directoryServer.disabledPrivileges;
}
/**
* Indicates whether the specified privilege is disabled.
*
* @param privilege The privilege for which to make the determination.
*
* @return {@code true} if the specified privilege is disabled, or
* {@code false} if not.
*/
{
}
/**
* Specifies the set of privileges that should be disabled in the server.
*
* @param disabledPrivileges The set of privileges that should be disabled
* in the server.
*/
{
}
/**
* Indicates whether responses to failed bind operations should include a
* message explaining the reason for the failure.
*
* @return {@code true} if bind responses should include error messages, or
* {@code false} if not.
*/
public static boolean returnBindErrorMessages()
{
}
/**
* Specifies whether responses to failed bind operations should include a
* message explaining the reason for the failure.
*
* @param returnBindErrorMessages Specifies whether responses to failed bind
* operations should include a message
* explaining the reason for the failure.
*/
public static void setReturnBindErrorMessages(boolean returnBindErrorMessages)
{
}
/**
* Retrieves the maximum length of time in milliseconds that client
* connections should be allowed to remain idle without being disconnected.
*
* @return The maximum length of time in milliseconds that client connections
* should be allowed to remain idle without being disconnected.
*/
public static long getIdleTimeLimit()
{
return directoryServer.idleTimeLimit;
}
/**
* Specifies the maximum length of time in milliseconds that client
* connections should be allowed to remain idle without being disconnected.
*
* @param idleTimeLimit The maximum length of time in milliseconds that
* client connections should be allowed to remain idle
* without being disconnected.
*/
public static void setIdleTimeLimit(long idleTimeLimit)
{
}
/**
* Indicates whether the Directory Server should save a copy of its
* configuration whenever it is started successfully.
*
* @return {@code true} if the server should save a copy of its configuration
* whenever it is started successfully, or {@code false} if not.
*/
public static boolean saveConfigOnSuccessfulStartup()
{
}
/**
* Specifies whether the Directory Server should save a copy of its
* configuration whenever it is started successfully.
*
* @param saveConfigOnSuccessfulStartup Specifies whether the server should
* save a copy of its configuration
* whenever it is started successfully.
*/
public static void setSaveConfigOnSuccessfulStartup(
boolean saveConfigOnSuccessfulStartup)
{
}
/**
* Registers the provided backup task listener with the Directory Server.
*
* @param listener The backup task listener to register with the Directory
* Server.
*/
{
}
/**
* Deregisters the provided backup task listener with the Directory Server.
*
* @param listener The backup task listener to deregister with the Directory
* Server.
*/
{
}
/**
* Notifies the registered backup task listeners that the server will be
* beginning a backup task with the provided information.
*
* @param backend The backend in which the backup is to be performed.
* @param config The configuration for the backup to be performed.
*/
{
{
try
{
}
catch (Exception e)
{
if (debugEnabled())
{
}
}
}
}
/**
* Notifies the registered backup task listeners that the server has completed
* processing on a backup task with the provided information.
*
* @param backend The backend in which the backup was performed.
* @param config The configuration for the backup that was performed.
* @param successful Indicates whether the backup completed successfully.
*/
boolean successful)
{
{
try
{
}
catch (Exception e)
{
if (debugEnabled())
{
}
}
}
}
/**
* Registers the provided restore task listener with the Directory Server.
*
* @param listener The restore task listener to register with the Directory
* Server.
*/
{
}
/**
* Deregisters the provided restore task listener with the Directory Server.
*
* @param listener The restore task listener to deregister with the
* Directory Server.
*/
{
}
/**
* Notifies the registered restore task listeners that the server will be
* beginning a restore task with the provided information.
*
* @param backend The backend in which the restore is to be performed.
* @param config The configuration for the restore to be performed.
*/
{
{
try
{
}
catch (Exception e)
{
if (debugEnabled())
{
}
}
}
}
/**
* Notifies the registered restore task listeners that the server has
* completed processing on a restore task with the provided information.
*
* @param backend The backend in which the restore was performed.
* @param config The configuration for the restore that was performed.
* @param successful Indicates whether the restore completed successfully.
*/
boolean successful)
{
{
try
{
}
catch (Exception e)
{
if (debugEnabled())
{
}
}
}
}
/**
* Registers the provided LDIF export task listener with the Directory Server.
*
* @param listener The export task listener to register with the Directory
* Server.
*/
{
}
/**
* Deregisters the provided LDIF export task listener with the Directory
* Server.
*
* @param listener The export task listener to deregister with the Directory
* Server.
*/
{
}
/**
* Notifies the registered LDIF export task listeners that the server will be
* beginning an export task with the provided information.
*
* @param backend The backend in which the export is to be performed.
* @param config The configuration for the export to be performed.
*/
{
{
try
{
}
catch (Exception e)
{
if (debugEnabled())
{
}
}
}
}
/**
* Notifies the registered LDIF export task listeners that the server has
* completed processing on an export task with the provided information.
*
* @param backend The backend in which the export was performed.
* @param config The configuration for the export that was performed.
* @param successful Indicates whether the export completed successfully.
*/
boolean successful)
{
{
try
{
}
catch (Exception e)
{
if (debugEnabled())
{
}
}
}
}
/**
* Registers the provided LDIF import task listener with the Directory Server.
*
* @param listener The import task listener to register with the Directory
* Server.
*/
{
}
/**
* Deregisters the provided LDIF import task listener with the Directory
* Server.
*
* @param listener The import task listener to deregister with the Directory
* Server.
*/
{
}
/**
* Notifies the registered LDIF import task listeners that the server will be
* beginning an import task with the provided information.
*
* @param backend The backend in which the import is to be performed.
* @param config The configuration for the import to be performed.
*/
{
{
try
{
}
catch (Exception e)
{
if (debugEnabled())
{
}
}
}
}
/**
* Notifies the registered LDIF import task listeners that the server has
* completed processing on an import task with the provided information.
*
* @param backend The backend in which the import was performed.
* @param config The configuration for the import that was performed.
* @param successful Indicates whether the import completed successfully.
*/
boolean successful)
{
{
try
{
}
catch (Exception e)
{
if (debugEnabled())
{
}
}
}
}
/**
* Registers the provided shutdown listener with the Directory Server so that
* it will be notified when the server shuts down.
*
* @param listener The shutdown listener to register with the Directory
* Server.
*/
{
}
/**
* Deregisters the provided shutdown listener with the Directory Server.
*
* @param listener The shutdown listener to deregister with the Directory
* Server.
*/
{
}
/**
* Initiates the Directory Server shutdown process. Note that once this has
* started, it should not be interrupted.
*
* @param className The fully-qualified name of the Java class that
* initiated the shutdown.
* @param reason The human-readable reason that the directory server is
* shutting down.
*/
{
synchronized (directoryServer)
{
{
// We already know that the server is shutting down, so we don't need to
// do anything.
return;
}
directoryServer.shuttingDown = true;
}
try {
} catch (Exception e) {
}
// Send an alert notification that the server is shutting down.
message);
// Create a shutdown monitor that will watch the rest of the shutdown
// process to ensure that everything goes smoothly.
// Shut down the connection handlers.
{
try
{
INFO_CONNHANDLER_CLOSED_BY_SHUTDOWN.get(), true);
}
catch (Exception e)
{
if (debugEnabled())
{
}
}
}
// Call the shutdown plugins, and then finalize all the plugins defined in
// the server.
{
}
// shutdown the Synchronization Providers
for (SynchronizationProvider provider :
{
}
// Deregister the shutdown hook.
{
try
{
}
catch (Exception e) {}
}
// Stop the work queue.
{
}
// Notify all the shutdown listeners.
{
try
{
}
catch (Exception e)
{
if (debugEnabled())
{
}
}
}
// Shut down all of the alert handlers.
{
}
// Deregister all of the JMX MBeans.
{
{
if (o instanceof DirectoryServerMBean)
{
try
{
}
catch (Exception e)
{
if (debugEnabled())
{
}
}
}
}
}
// Finalize all of the SASL mechanism handlers.
for (SASLMechanismHandler handler :
{
try
{
}
catch (Exception e)
{
if (debugEnabled())
{
}
}
}
// Finalize all of the extended operation handlers.
for (ExtendedOperationHandler handler :
{
try
{
}
catch (Exception e)
{
if (debugEnabled())
{
}
}
}
// Finalize the password policy map.
{
}
// Finalize the access control handler
if (accessControlHandler != null)
{
}
// Perform any necessary cleanup work for the group manager.
{
}
// Shut down all the other components that may need special handling.
// NYI
// Shut down the monitor providers.
{
try
{
}
catch (Exception e)
{
if (debugEnabled())
{
}
}
}
// Shut down the backends.
{
try
{
// Deregister all the local backend workflow elements that have been
// registered with the server.
{
}
// Remove the shared lock for this backend.
try
{
{
// FIXME -- Do we need to send an admin alert?
}
serverLocked = false;
}
{
if (debugEnabled())
{
}
// FIXME -- Do we need to send an admin alert?
}
}
catch (Exception e)
{
if (debugEnabled())
{
}
}
}
// Finalize the entry cache.
{
}
// Release the exclusive lock for the Directory Server process.
try
{
{
}
}
catch (Exception e)
{
if (debugEnabled())
{
}
}
// Deregister all workflows.
// Deregister all network group configuration.
// Force a new InternalClientConnection to be created on restart.
// Log a final message indicating that the server is stopped (which should
// be true for all practical purposes), and then shut down all the error
// loggers.
// Just in case there's something that isn't shut down properly, wait for
// the monitor to give the OK to stop.
// At this point, the server is no longer running. We should destroy the
// handle to the previous instance, but we will want to get a new instance
// in case the server is to be started again later in the same JVM. Before
// doing that, destroy the previous instance.
}
/**
* Destroy key structures in the current Directory Server instance in a manner
* that can help detect any inappropriate cached references to server
* components.
*/
private void destroy()
{
checkSchema = true;
isBootstrapped = false;
isClientBootstrapped = false;
isRunning = false;
lockdownMode = true;
rejectUnauthenticatedRequests = true;
shuttingDown = true;
configClass = null;
configFile = null;
entryCache = null;
shutdownHook = null;
if (baseDnRegistry != null)
{
}
{
}
{
}
}
/**
* Causes the Directory Server to perform an in-core restart. This will
* cause virtually all components of the Directory Server to shut down, and
* once that has completed it will be restarted.
*
* @param className The fully-qualified name of the Java class that
* initiated the shutdown.
* @param reason The human-readable reason that the directory server is
* shutting down.
*/
{
}
/**
* Causes the Directory Server to perform an in-core restart. This will
* cause virtually all components of the Directory Server to shut down, and
* once that has completed it will be restarted.
*
* @param className The fully-qualified name of the Java class that
* initiated the shutdown.
* @param reason The human-readable reason that the directory server is
* shutting down.
* @param config The environment configuration to use for the server.
*/
{
try
{
}
catch (Exception e)
{
e.printStackTrace();
"restarted.");
}
}
/**
* Reinitializes the server following a shutdown, preparing it for a call to
* {@code startServer}.
*
* @return The new Directory Server instance created during the
* reinitialization process.
*
* @throws InitializationException If a problem occurs while trying to
* initialize the config handler or
* bootstrap that server.
*/
public static DirectoryServer reinitialize()
throws InitializationException
{
}
/**
* Reinitializes the server following a shutdown, preparing it for a call to
* {@code startServer}.
*
* @param config The environment configuration for the Directory Server.
*
* @return The new Directory Server instance created during the
* reinitialization process.
*
* @throws InitializationException If a problem occurs while trying to
* initialize the config handler or
* bootstrap that server.
*/
throws InitializationException
{
return directoryServer;
}
/**
* Retrieves the maximum number of concurrent client connections that may be
* established.
*
* @return The maximum number of concurrent client connections that may be
* established, or -1 if there is no limit.
*/
public static long getMaxAllowedConnections()
{
return directoryServer.maxAllowedConnections;
}
/**
* Specifies the maximum number of concurrent client connections that may be
* established. A value that is less than or equal to zero will indicate that
* no limit should be enforced.
*
* @param maxAllowedConnections The maximum number of concurrent client
* connections that may be established.
*/
public static void setMaxAllowedConnections(long maxAllowedConnections)
{
if (maxAllowedConnections > 0)
{
}
else
{
}
}
/**
* Indicates that a new connection has been accepted and increments the
* associated counters.
*
* @param clientConnection The client connection that has been established.
*
* @return The connection ID that should be used for this connection, or -1
* if the connection has been rejected for some reason (e.g., the
* maximum numberof concurrent connections have already been
* established).
*/
{
synchronized (directoryServer.establishedConnections)
{
{
{
return -1;
}
}
{
return -1;
}
{
}
return directoryServer.totalConnections++;
}
}
/**
* Indicates that the specified client connection has been closed.
*
* @param clientConnection The client connection that has been closed.
*/
{
synchronized (directoryServer.establishedConnections)
{
}
}
/**
* Retrieves the number of client connections that are currently established.
*
* @return The number of client connections that are currently established.
*/
public static long getCurrentConnections()
{
return directoryServer.currentConnections;
}
/**
* Retrieves the maximum number of client connections that have been
* established concurrently.
*
* @return The maximum number of client connections that have been
* established concurrently.
*/
public static long getMaxConnections()
{
return directoryServer.maxConnections;
}
/**
* Retrieves the total number of client connections that have been established
* since the Directory Server started.
*
* @return The total number of client connections that have been established
* since the Directory Server started.
*/
public static long getTotalConnections()
{
return directoryServer.totalConnections;
}
/**
* Retrieves the full version string for the Directory Server.
*
* @return The full version string for the Directory Server.
*/
public static String getVersionString()
{
return FULL_VERSION_STRING;
}
/**
* Prints out the version string for the Directory Server.
*
*
* @param outputStream The output stream to which the version information
* should be written.
*
* @throws IOException If a problem occurs while attempting to write the
* version information to the provided output stream.
*/
throws IOException
{
return;
}
/**
* Retrieves the default maximum number of entries that should be returned for
* a search.
*
* @return The default maximum number of entries that should be returned for
* a search.
*/
public static int getSizeLimit()
{
return directoryServer.sizeLimit;
}
/**
* Specifies the default maximum number of entries that should be returned for
* a search.
*
* @param sizeLimit The default maximum number of entries that should be
* returned for a search.
*/
public static void setSizeLimit(int sizeLimit)
{
}
/**
* Retrieves the default maximum number of entries that should checked for
* matches during a search.
*
* @return The default maximum number of entries that should checked for
* matches during a search.
*/
public static int getLookthroughLimit()
{
return directoryServer.lookthroughLimit;
}
/**
* Specifies the default maximum number of entries that should be checked for
* matches during a search.
*
* @param lookthroughLimit The default maximum number of entries that should
* be check for matches during a search.
*/
public static void setLookthroughLimit(int lookthroughLimit)
{
}
/**
* Retrieves the default maximum length of time in seconds that should be
* allowed when processing a search.
*
* @return The default maximum length of time in seconds that should be
* allowed when processing a search.
*/
public static int getTimeLimit()
{
return directoryServer.timeLimit;
}
/**
* Specifies the default maximum length of time in seconds that should be
* allowed when processing a search.
*
* @param timeLimit The default maximum length of time in seconds that
* should be allowed when processing a search.
*/
public static void setTimeLimit(int timeLimit)
{
}
/**
* Retrieves the writability mode for the Directory Server. This will only
* be applicable for user suffixes.
*
* @return The writability mode for the Directory Server.
*/
public static WritabilityMode getWritabilityMode()
{
return directoryServer.writabilityMode;
}
/**
* Specifies the writability mode for the Directory Server. This will only
* be applicable for user suffixes.
*
* @param writabilityMode Specifies the writability mode for the Directory
* Server.
*/
{
}
/**
* Indicates whether simple bind requests that contain a bind DN will also be
* required to have a password.
*
* @return <CODE>true</CODE> if simple bind requests containing a bind DN
* will be required to have a password, or <CODE>false</CODE> if not
* (and therefore will be treated as anonymous binds).
*/
public static boolean bindWithDNRequiresPassword()
{
}
/**
* Specifies whether simple bind requests that contain a bind DN will also be
* required to have a password.
*
* @param bindWithDNRequiresPassword Indicates whether simple bind requests
* that contain a bind DN will also be
* required to have a password.
*/
public static void setBindWithDNRequiresPassword(boolean
{
}
/**
* Indicates whether an unauthenticated request should be rejected.
*
* @return <CODE>true</CODE>if an unauthenticated request should be
* rejected, or <CODE>false</CODE>f if not.
*/
public static boolean rejectUnauthenticatedRequests()
{
}
/**
* Specifies whether an unauthenticated request should be rejected.
*
* @param rejectUnauthenticatedRequests Indicates whether an
* unauthenticated request should
* be rejected.
*/
public static void setRejectUnauthenticatedRequests(boolean
{
}
/**
* Indicates whether the Directory Server is currently configured to operate
* in the lockdown mode, in which all non-root requests will be rejected and
* all connection attempts from non-loopback clients will be rejected.
*
* @return {@code true} if the Directory Server is currently configured to
* operate in the lockdown mode, or {@code false} if not.
*/
public static boolean lockdownMode()
{
return directoryServer.lockdownMode;
}
/**
* Specifies whether the server should operate in lockdown mode.
*
* @param lockdownMode Indicates whether the Directory Server should operate
* in lockdown mode.
*/
public static void setLockdownMode(boolean lockdownMode)
{
if (lockdownMode)
{
message);
}
else
{
message);
}
}
/**
* Retrieves the DN of the configuration entry with which this alert generator
* is associated.
*
* @return The DN of the configuration entry with which this alert generator
* is associated.
*/
public DN getComponentEntryDN()
{
try
{
if (configHandler == null)
{
// The config handler hasn't been initialized yet. Just return the DN
// of the root DSE.
}
}
catch (Exception e)
{
if (debugEnabled())
{
}
// This could theoretically happen if an alert needs to be sent before the
// configuration is initialized. In that case, just return an empty DN.
}
}
/**
* Retrieves the fully-qualified name of the Java class for this alert
* generator implementation.
*
* @return The fully-qualified name of the Java class for this alert
* generator implementation.
*/
public String getClassName()
{
return CLASS_NAME;
}
/**
* Retrieves information about the set of alerts that this generator may
* produce. The map returned should be between the notification type for a
* particular notification and the human-readable description for that
* notification. This alert generator must not generate any alerts with types
* that are not contained in this list.
*
* @return Information about the set of alerts that this generator may
* produce.
*/
{
return alerts;
}
/**
* Provides a means of handling a case in which a thread is about to die
* because of an unhandled exception. This method does nothing to try to
* prevent the death of that thread, but will at least log it so that it can
* be available for debugging purposes.
*
* @param thread The thread that threw the exception.
* @param exception The exception that was thrown but not properly handled.
*/
{
if (debugEnabled())
{
}
}
/**
* Indicates whether the server is currently in the process of shutting down.
* @return <CODE>true</CODE> if this server is currently in the process of
* shutting down and <CODE>false</CODE> otherwise.
*/
public boolean isShuttingDown()
{
return shuttingDown;
}
/**
* Parses the provided command-line arguments and uses that information to
* bootstrap and start the Directory Server.
*
* @param args The command-line arguments provided to this program.
*/
{
// Define the arguments that may be provided to the server.
// Create the command-line argument parser for use with this program.
new ArgumentParser("org.opends.server.core.DirectoryServer",
toolDescription, false);
// Initialize all the command-line argument types and register them with the
// parser.
try
{
true, false, true, "{configClass}",
.get());
configClass.setHidden(true);
true, false, true, "{configFile}", null,
null,
.get());
configFile.setHidden(true);
"checkStartability",
checkStartability.setHidden(true);
"windowsNetStart",
windowsNetStart.setHidden(true);
.get());
fullVersion.setHidden(true);
"useLastKnownGoodConfig",
}
catch (ArgumentException ae)
{
}
// Parse the command-line arguments provided to this program.
try
{
}
catch (ArgumentException ae)
{
}
// If we should just display usage information, then print it and exit.
if (checkStartability.isPresent())
{
// This option should only be used if a PID file already exists in the
// server logs directory, and we need to check which of the following
// conditions best describes the current usage:
// - We're trying to start the server, but it's already running. The
// attempt to start the server should fail, and the server process will
// exit with a result code of 98.
// - We're trying to start the server and it's not already running. We
// won't start it in this invocation, but the script used to get to this
// point should go ahead and overwrite the PID file and retry the
// startup process. The server process will exit with a result code of
// 99.
// - We're not trying to start the server, but instead are trying to do
// something else like display the version number. In that case, we
// don't need to write the PID file at all and can just execute the
// intended command. If that command was successful, then we'll have an
// exit code of NOTHING_TO_DO (0). Otherwise, it will have an exit code
// that is something other than NOTHING_TO_DO, SERVER_ALREADY_STARTED,
// START_AS_DETACH, START_AS_NON_DETACH, START_AS_WINDOWS_SERVICE to
// indicate that a problem occurred.
if (argParser.usageOrVersionDisplayed())
{
// We're just trying to display usage, and that's already been done so
// exit with a code of zero.
}
{
// We're not really trying to start, so rebuild the argument list
// without the "--checkStartability" argument and try again. Exit with
// whatever that exits with.
{
{
}
}
}
else
{
}
}
else if (argParser.usageOrVersionDisplayed())
{
}
else if (fullVersion.isPresent())
{
if (BUILD_NUMBER > 0)
{
}
return;
}
else if (systemInfo.isPresent())
{
if (sunOsArchDataModel != null)
{
{
}
}
else
{
}
try
{
}
catch (Exception e)
{
}
return;
}
// At this point, we know that we're going to try to start the server.
// Attempt to grab an exclusive lock for the Directory Server process.
try
{
{
}
}
catch (Exception e)
{
if (debugEnabled())
{
}
}
serverLocked = true;
// Configure the JVM to delete the PID file on exit, if it exists.
boolean pidFileMarkedForDeletion = false;
boolean startingFileMarkedForDeletion = false;
try
{
if (serverRoot == null)
{
pidFilePath = "logs/server.pid";
}
else
{
}
{
pidFileMarkedForDeletion = true;
}
if (startingFile.exists())
{
startingFileMarkedForDeletion = true;
}
} catch (Exception e) {}
// Redirect standard output and standard error to the server.out file. If
// the server hasn't detached from the terminal, then also continue writing
// to the original standard output and standard error. Also, configure the
// JVM to delete the PID and server.starting files on exit, if they exist.
try
{
// We need to figure out where to put the file. See if the server root
// is available as an environment variable and if so then use it.
// Otherwise, try to figure it out from the location of the config file.
if (serverRoot == null)
{
}
if (serverRoot == null)
{
"order to redirect standard output and standard " +
"error.");
}
else
{
{
{
{
}
}
if (! pidFileMarkedForDeletion)
{
if (f.exists())
{
f.deleteOnExit();
}
}
{
if (f.exists())
{
f.deleteOnExit();
}
}
}
else
{
"and standard error because the logs directory " +
}
}
}
catch (Exception e)
{
"standard error: " + stackTraceToSingleLineString(e));
}
// Create an environment configuration for the server and populate a number
// of appropriate properties.
new DirectoryEnvironmentConfig();
try
{
configClass.getValue());
configFile.getValue());
new TextWriter.STDOUT());
new TextWriter.STDOUT());
}
catch (Exception e)
{
// This shouldn't happen. For the methods we are using, the exception is
// just a guard against making changes with the server running.
}
// Bootstrap and start the Directory Server.
try
{
configFile.getValue());
}
catch (InitializationException ie)
{
if (debugEnabled())
{
}
}
catch (Exception e)
{
}
try
{
}
catch (InitializationException ie)
{
if (debugEnabled())
{
}
}
catch (Exception e)
{
}
}
/**
* Construct the DN of a monitor provider entry.
* @param provider The monitor provider for which a DN is desired.
* @return The DN of the monitor provider entry.
*/
{
try
{
}
catch (DirectoryException e)
{
// Cannot reach this point.
throw new RuntimeException();
}
}
/**
* Gets the class loader to be used with this directory server
* application.
* <p>
* The class loader will automatically load classes from plugins
* where required.
*
* @return Returns the class loader to be used with this directory
* server application.
*/
public static ClassLoader getClassLoader()
{
}
/**
* Loads the named class using this directory server application's
* class loader.
* <p>
* This method provided as a convenience and is equivalent to
* calling:
*
* <pre>
* Class.forName(name, true, DirectoryServer.getClassLoader());
* </pre>
*
* @param name
* The fully qualified name of the desired class.
* @return Returns the class object representing the desired class.
* @throws LinkageError
* If the linkage fails.
* @throws ExceptionInInitializerError
* If the initialization provoked by this method fails.
* @throws ClassNotFoundException
* If the class cannot be located by the specified class
* loader.
* @see Class#forName(String, boolean, ClassLoader)
*/
{
}
/**
* Returns the error code that we return when we are checking the startability
* of the server.
* If there are conflicting arguments (like asking to run the server in non
* detach mode when the server is configured to run as a window service) it
* returns CHECK_ERROR (1).
* @param argParser the ArgumentParser with the arguments already parsed.
* @return the error code that we return when we are checking the startability
* of the server.
*/
{
int returnValue;
boolean isServerRunning;
// We're trying to start the server, so see if it's already running by
// trying to grab an exclusive lock on the server lock file. If it
// succeeds, then the server isn't running and we can try to start.
// Otherwise, the server is running and this attempt should fail.
try
{
{
// The server isn't running, so it can be started.
isServerRunning = false;
}
else
{
// The server's already running.
isServerRunning = true;
}
}
catch (Exception e)
{
// We'll treat this as if the server is running because we won't
// be able to start it anyway.
getExceptionMessage(e));
isServerRunning = true;
}
boolean configuredAsService = isRunningAsWindowsService();
if (isServerRunning)
{
{
}
else
{
}
}
else
{
if (configuredAsService)
{
if (noDetachPresent)
{
// Conflicting arguments
}
else
{
{
// start-ds.bat is being called through net start, so return
// START_AS_DETACH_CALLED_FROM_WINDOWS_SERVICE so that the batch
// file actually starts the server.
}
else
{
}
}
}
else
{
if (noDetachPresent)
{
}
{
}
else
{
}
}
}
return returnValue;
}
/**
* Returns true if this server is configured to run as a windows service.
* @return <CODE>true</CODE> if this server is configured to run as a windows
* service and <CODE>false</CODE> otherwise.
*/
public static boolean isRunningAsWindowsService()
{
boolean isRunningAsWindowsService;
if (SetupUtils.isWindows())
{
}
else
{
isRunningAsWindowsService = false;
}
return isRunningAsWindowsService;
}
}