DirectoryServer.java revision 7d2ed0b575ab7daccff664179046474a929a44c5
/*
* 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 legal-notices/CDDLv1_0.txt
* 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 legal-notices/CDDLv1_0.txt.
* 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
*
*
* Copyright 2006-2010 Sun Microsystems, Inc.
* Portions Copyright 2010-2015 ForgeRock AS.
*/
/**
* This class defines the core of the Directory Server. It manages the startup
* and shutdown processes and coordinates activities between all other
* components.
*/
public final class DirectoryServer
implements AlertGenerator
{
/** The singleton Directory Server instance. */
/**
* Indicates whether the server currently holds an exclusive lock on the
* server lock file.
*/
private static boolean serverLocked;
/**
* The message to be displayed on the command-line when the user asks for the
* usage.
*/
/**
* 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 final int NOTHING_TO_DO = 0;
/**
* Returned when the user specified the --checkStartability option with
* some incompatible arguments.
*/
private static final int CHECK_ERROR = 1;
/** The server is already started. */
private static final int SERVER_ALREADY_STARTED = 98;
/** The server must be started as detached process. */
private static final int START_AS_DETACH = 99;
/** The server must be started as a non-detached process. */
private static final int START_AS_NON_DETACH = 100;
/** The server must be started as a window service. */
private static final int START_AS_WINDOWS_SERVICE = 101;
/**
* The server must be started as detached and it is being called from the
* Windows Service.
*/
private static final 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 final int START_AS_DETACH_QUIET = 103;
/**
* The server must be started as non-detached process and should not produce
* any output.
*/
private static final int START_AS_NON_DETACH_QUIET = 104;
/** Temporary context object, to provide instance methods instead of static methods. */
private final DirectoryServerContext serverContext;
/** 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. */
private AccountStatusNotificationHandlerConfigManager accountStatusNotificationHandlerConfigManager;
/** 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 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. */
/** 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 authentication 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.
*/
/** 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 supported LDAP protocol versions. */
/**
* 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.
*/
/**
* 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 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 restore task listeners registered with the Directory Server. */
/**
* The set of initialization completed listeners that have been registered
* with the Directory Server.
*/
private List<InitializationCompletedListener>
/**
* 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.
*/
/**
* The set of backend initialization listeners registered with the Directory
* Server.
*/
private Set<BackendInitializationListener>
/** 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 CryptoManagerImpl 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 subentry manager for the Directory Server. */
private SubentryManager subentryManager;
/** 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 maximum number of candidates that should be check for matches during a
* search.
*/
private int lookthroughLimit;
/** The current active persistent searches. */
/** The maximum number of concurrent persistent searches. */
private int maxPSearches;
/**
* Whether to use collect operation processing times in nanosecond resolution.
*/
private boolean useNanoTime;
/**
* 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 final OperatingSystem operatingSystem;
/** The configuration handler used to manage the password generators. */
/** The default password policy for the Directory Server. */
private PasswordPolicy defaultPasswordPolicy;
/** The configuration handler used to manage the authentication 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 for the Directory Server. */
// TODO : temporary field to be removed once old schema is completely removed
/** 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.
*/
/** Registry for base DN and naming context information. */
private BaseDnRegistry baseDnRegistry;
/** The set of backends registered with the server. */
/** 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.
*/
private final VirtualAttributeConfigManager virtualAttributeConfigManager;
/** The work queue that will be used to service client requests. */
/** The writability mode for the Directory Server. */
private WritabilityMode writabilityMode;
/** The memory reservation system */
private MemoryQuota memoryQuota;
/** The Disk Space Monitor */
private DiskSpaceMonitor diskSpaceMonitor;
/**
* The maximum size that internal buffers will be allowed to grow to until
* they are trimmed.
*/
private int maxInternalBufferSize = DEFAULT_MAX_INTERNAL_BUFFER_SIZE;
/**
* The default timeout used to start the server in detach mode.
*/
public static final int DEFAULT_TIMEOUT = 200;
/** Entry point for server configuration. */
/**
* Class that prints the version of OpenDJ server to System.out.
*/
public static final class DirectoryServerVersionHandler implements VersionHandler
{
/** {@inheritDoc} */
public void printVersion()
{
try
{
}
catch (Exception e){}
}
}
/**
* Temporary class to provide instance methods instead of static methods for
* server. Once all static methods related to context are removed from the
* server then DirectoryServer class can be used directly as implementation of
* ServerContext.
*/
private class DirectoryServerContext implements ServerContext
{
/** {@inheritDoc} */
public String getInstanceRoot()
{
return DirectoryServer.getInstanceRoot();
}
/** {@inheritDoc} */
public String getServerRoot()
{
return DirectoryServer.getServerRoot();
}
/** {@inheritDoc} */
{
return directoryServer.schema;
}
/** {@inheritDoc} */
public DirectoryEnvironmentConfig getEnvironment()
{
return directoryServer.environmentConfig;
}
/** {@inheritDoc} */
public SchemaUpdater getSchemaUpdater()
{
return new SchemaUpdater()
{
{
return true;
}
public SchemaBuilder getSchemaBuilder()
{
return new SchemaBuilder(schemaNG);
}
};
}
/** {@inheritDoc} */
{
return serverManagementContext;
}
public MemoryQuota getMemoryQuota()
{
return directoryServer.memoryQuota;
}
public DiskSpaceMonitor getDiskSpaceMonitor()
{
return directoryServer.diskSpaceMonitor;
}
}
/**
* 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;
isRunning = false;
shuttingDown = false;
lockdownMode = false;
serverContext = new DirectoryServerContext();
memoryQuota = new MemoryQuota();
diskSpaceMonitor = new DiskSpaceMonitor();
}
/**
* 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(
}
}
/**
* Returns the server context.
*
* @return the server context
*/
public ServerContext getServerContext() {
return serverContext;
}
/**
* 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)
{
// 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>>();
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.
*/
private 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;
}
// Add a shutdown hook so that the server can be notified when the JVM
// starts shutting down.
shutdownHook = new DirectoryServerShutdownHook();
// 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.
// 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
{
// It is recommended by ManagementFactory javadoc that the platform
// MBeanServer also be used to register other application managed
// beans besides the platform MXBeans. Try platform MBeanServer
// first. If it fails create a new, private, MBeanServer instance.
try
{
}
catch (Exception e)
{
logger.traceException(e);
}
}
catch (Exception e)
{
logger.traceException(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)
{
logger.traceException(e);
throw new InitializationException(message, e);
}
}
/**
* Initialize this server.
* <p>
* Initialization involves the following steps:
* <ul>
* <li>Configuration</li>
* <li>Schema</li>
* </ul>
* @throws InitializationException
*/
private void initializeNG() throws InitializationException
{
// TODO : config backend should be initialized later, with the other backends
//ConfigBackend configBackend = new ConfigBackend();
//configBackend.initializeConfigBackend(serverContext, configurationHandler);
}
/**
* Initialize the schema of this server.
*/
private void initializeSchemaNG() throws InitializationException
{
try
{
}
{
// TODO : fix message
}
}
/**
* 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)
{
logger.traceException(e);
throw new InitializationException(message, e);
}
// Perform the handler-specific initialization.
try
{
try
{
}
{
}
}
catch (InitializationException ie)
{
throw ie;
}
catch (Exception e)
{
logger.traceException(e);
throw new InitializationException(message, e);
}
}
/**
* 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()
{
// Checks the version - if upgrade required, cannot launch the server.
try
{
}
catch (InitializationException e)
{
logger.traceException(e);
throw new InitializationException(e.getMessageObject());
}
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)
{
logger.traceException(e);
throw new InitializationException(message, e);
}
}
// Mark the current time as the start time.
// Determine whether or not we should start the connection handlers.
// Allow internal plugins to be registered.
// The core Directory Server configuration.
// Initialize the default entry cache. We have to have one before
// <CODE>initializeBackends()</CODE> method kicks in further down.
// Initialize the administration connector self signed certificate if
// needed and do this before initializing the key managers so that it is
// picked up.
{
}
// initialize both subentry manager and group manager for this backend.
// Initialize both subentry manager and group manager
// for the configuration backend.
// TODO : why do we initialize these now ? Can't we do them after backend initialization ?
// Initialize all the backends and their associated suffixes
// and initialize the workflows when workflow configuration mode is auto.
// configure the remaining workflows (rootDSE and config backend).
// Check for and initialize user configured entry cache if any.
// If not then stick with default entry cache initialized earlier.
{
// Includes the administration connector.
}
{
}
if (! startupPluginResult.continueProcessing())
{
throw new InitializationException(ERR_STARTUP_PLUGIN_ERROR.get(startupPluginResult.getErrorMessage(),
}
{
try
{
}
catch (Exception e)
{
logger.traceException(e);
}
}
{
new IdleTimeLimitThread().start();
}
// Synchronization of ADS with the crypto manager.
new CryptoManagerSync();
// Write a copy of the config if needed.
{
}
isRunning = true;
// Force the root connection to be initialized.
{
}
}
}
/** Delete "server.starting" and "hostname" files if they are present. */
private void deleteUnnecessaryFiles()
{
if (serverStartingFile.exists())
{
}
File hostNameFile = new File(configHandler.getInstanceRoot() + File.separator + SetupUtils.HOST_NAME_FILE);
if (hostNameFile.exists())
{
}
}
/** Initializes authenticated users. */
public void initializeAuthenticatedUsers()
{
}
/**
* 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()
{
MatchingRuleFactory<?>[] factories =
new MatchingRuleFactory<?>[] {
try
{
{
{
registerMatchingRule(matchingRule, true);
}
}
}
catch (Exception e)
{
logger.traceException(e);
}
}
/**
* 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()
{
initAndRegister(new AttributeTypeSyntax());
initAndRegister(new IA5StringSyntax());
initAndRegister(new GeneralizedTimeSyntax());
initAndRegister(new ObjectClassSyntax());
initAndRegister(new OIDSyntax());
initAndRegister(new TelephoneNumberSyntax());
}
{
try
{
}
catch (Exception e)
{
logger.traceException(e);
}
return syntax;
}
/**
* 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 CryptoManagerImpl 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 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.
// 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)
{
logger.traceException(e);
}
try
{
}
catch (InitializationException ie)
{
throw ie;
}
catch (Exception e)
{
logger.traceException(e);
}
// 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(
{
}
/**
* Deregisters 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.
*/
{
// Make sure to initialize the root DSE backend separately after all other
// backends.
try
{
}
catch (Exception e)
{
logger.traceException(e);
stackTraceToSingleLineString(e)), e);
}
rootDSEBackend = new RootDSEBackend();
}
/**
* Creates a set of workflows for a given backend and registers the
* workflows with the default network group, the internal network group
* and he admin network group. There are as many workflows
* as base DNs defined in the backend.
*
* @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.
*/
{
// Create a workflow for each backend base DN and register the workflow
{
}
}
/**
* Creates one workflow for a given base DN in a backend.
*
* @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.
*/
{
}
/**
* Creates the missing workflows, one for the config backend and one for
* the rootDSE backend.
*
* This method should be invoked whatever may be the workflow
* configuration mode because config backend and rootDSE backend
* will not have any configuration section, ever.
*
* @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.
*/
private void initializeGroupManager()
{
try
{
}
catch (DirectoryException de)
{
}
// The configuration backend has already been registered by this point
// so we need to handle it explicitly.
// Because subentryManager may depend on the groupManager, let's
// delay this.
// groupManager.performBackendInitializationProcessing(configHandler);
}
/**
* Retrieves the Directory Server group manager.
*
* @return The Directory Server group manager.
*/
public static GroupManager getGroupManager()
{
return directoryServer.groupManager;
}
/**
* Retrieves the Directory Server subentry manager.
*
* @return The Directory Server subentry manager.
*/
public static SubentryManager getSubentryManager()
{
return directoryServer.subentryManager;
}
/**
* 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()
{
}
/**
* 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()
{
if (connectionHandlerConfigManager == null) {
}
}
/**
* Initializes the subentry manager for the Directory Server.
* Note that the subentry manager initialization should be
* done before any dependent components initialization and
* before bringing any backends online. Configuration backend
* is a special case and therefore is exception to this rule.
*
* @throws InitializationException If a problem occurs while
* initializing the subentry
* manager.
*/
public void initializeSubentryManager()
throws InitializationException
{
try
{
subentryManager = new SubentryManager();
// The configuration backend should already be registered
// at this point so we need to handle it explicitly here.
// However, subentryManager may have dependencies on the
// groupManager. So lets delay the backend initialization until then.
// subentryManager.performBackendInitializationProcessing(
// configHandler);
}
catch (DirectoryException de)
{
}
}
/**
* Initializes the set of authentication policy components for use by the
* Directory Server.
*
* @throws ConfigException
* If there is a configuration problem with any of the
* authentication policy components.
* @throws InitializationException
* If a problem occurs while initializing the authentication policy
* components that is not related to the server configuration.
*/
public void initializeAuthenticationPolicyComponents() throws ConfigException, InitializationException
{
accountStatusNotificationHandlerConfigManager = new AccountStatusNotificationHandlerConfigManager(serverContext);
}
/**
* 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 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. 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.
*/
{
}
/**
* Initializes the root DN Config Manager in the Directory Server.
*
* @throws ConfigException If a problem occurs registering a DN.
* @throws InitializationException If a problem occurs initializing the root
* DN manager.
*/
public void initializeRootDNConfigManager()
throws ConfigException, InitializationException{
}
/**
* Initialize the root DSE in the Directory Server.
*
* @throws ConfigException If a problem occurs retrieving the root DSE backend
* configuration.
* @throws InitializationException If a problem occurs initializing the root
* root DSE backend.
*/
public void initializeRootDSE()
throws ConfigException, InitializationException {
try {
} catch (Exception e) {
logger.traceException(e);
throw new InitializationException(message, e);
}
rootDSEBackend = new RootDSEBackend();
}
/**
* 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;
}
/**
* Registers the provided internal plugin with the Directory Server
* and ensures that it will be invoked in the specified ways.
*
* @param plugin
* The internal plugin to register with the Directory Server.
* The plugin must specify a configuration entry which is
* guaranteed to be unique.
*/
public static void registerInternalPlugin(
{
}
/**
* Deregisters the provided internal plugin with the Directory Server.
*
* @param plugin
* The internal plugin to deregister from the Directory Server.
*/
public static void deregisterInternalPlugin(
{
}
/**
* 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()
{
}
/**
* Retrieves the path to the instance directory for this instance of the
* Directory Server.
*
* @return The path to the instance directory for this instance of
* the Directory Server.
*/
public static String getInstanceRoot()
{
}
/**
* 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 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 objectclasses defined in the Directory Server.
*
* @return The set of objectclasses 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)
{
// Temporary object classes are immediately dirty.
}
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 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)
{
logger.traceException(e);
}
}
"( 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.
logger.traceException(e);
}
}
}
}
/**
* 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.
*/
{
// Temporary attribute types are immediately dirty.
AttributeUsage.USER_APPLICATIONS, false, false,
false, false).setDirty();
}
/**
* Retrieves the set of attribute syntaxes defined in the Directory Server.
*
* @return The set of attribute syntaxes defined in the Directory Server.
*/
public static ConcurrentMap<String,
{
}
/**
* 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 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 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 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 name forms associated with the specified objectclass.
*
* @param objectClass The objectclass for which to retrieve the associated
* name form.
*
* @return The requested name forms, 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.
*/
{
}
/**
* 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.
*/
{
}
/**
* Deregisters the provided virtual attribute rule with the Directory Server.
*
* @param rule The virtual attribute rule to be deregistered.
*/
{
}
/**
* 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)
{
logger.traceException(e);
}
}
}
else
{
{
{
{
continue;
}
}
else
{
{
{
continue;
}
}
else
{
continue;
}
}
}
}
String alertID = alertMessage != null ? alertMessage.resourceName() + "-" + alertMessage.ordinal() : "-1";
logger.info(NOTE_SENT_ALERT_NOTIFICATION, generator.getClassName(), alertType, alertID, alertMessage);
}
/**
* 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 ConcurrentMap<DN,
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.
*/
{
}
/**
* Returns an unmodifiable collection containing all of the authentication
* policies registered with the Directory Server. The references returned are
* to the actual authentication policy objects currently in use by the
* directory server and the referenced objects must not be modified.
*
* @return The unmodifiable collection containing all of the authentication
* policies registered with the Directory Server.
*/
{
return Collections
}
/**
* Retrieves the authentication policy registered for the provided
* configuration entry.
*
* @param configEntryDN
* The DN of the configuration entry for which to retrieve the
* associated authentication policy.
* @return The authentication policy registered for the provided configuration
* entry, or <CODE>null</CODE> if there is no such policy.
*/
{
}
/**
* Registers the provided authentication 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 authentication
* policy.
* @param policy
* The authentication policy to register with the server.
*/
{
// Ensure default policy is synchronized.
synchronized (directoryServer.authenticationPolicies)
{
{
// The correct policy type is enforced by the core config manager.
}
{
}
}
}
/**
* Deregisters the provided authentication 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 authentication
* policy to deregister.
*/
{
// Ensure default policy is synchronized.
synchronized (directoryServer.authenticationPolicies)
{
{
}
{
}
}
}
/**
* 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()
{
synchronized (directoryServer.authenticationPolicies)
{
}
}
/**
* Specifies the DN of the configuration entry for the default authentication
* policy for the Directory Server. This routine does not check the registered
* authentication policies for the specified DN, since in the case of server
* initialization, the authentication policy entries will not yet have been
* loaded from the configuration backend.
*
* @param defaultPasswordPolicyDN
* The DN of the configuration entry for the default authentication
* policy for the Directory Server.
*/
{
// Ensure default policy is synchronized.
synchronized (directoryServer.authenticationPolicies)
{
}
}
/**
* Retrieves the default password policy for the Directory Server. This
* method is equivalent to invoking <CODE>getAuthenticationPolicy</CODE> on
* the DN returned from
* <CODE>DirectoryServer.getDefaultPasswordPolicyDN()</CODE>.
*
* @return The default password policy for the Directory Server.
*/
public static PasswordPolicy getDefaultPasswordPolicy()
{
// Ensure default policy is synchronized.
synchronized (directoryServer.authenticationPolicies)
{
"Internal Error: no default password policy defined.";
{
// The correct policy type is enforced by the core config manager.
}
"Internal Error: inconsistency between defaultPasswordPolicy"
+ " cache and value in authenticationPolicies map.";
return directoryServer.defaultPasswordPolicy;
}
}
/**
* 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 ConcurrentMap<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)
{
logger.traceException(e);
}
}
/**
* Deregisters the specified monitor provider from the Directory Server. If no
* such monitor provider is registered, no action will be taken.
*
* @param monitorProvider
* The monitor provider to deregister from the Directory Server.
*/
public static void deregisterMonitorProvider(
{
// Try to deregister the monitor provider as an MBean.
{
try
{
{
}
}
catch (Exception e)
{
logger.traceException(e);
}
}
}
/**
* 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.
*/
{
}
/**
* 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.
*/
{
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 so we can remove it
{
}
{
}
}
}
/**
* 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 registry
*/
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.
*/
throws DirectoryException
{
synchronized (directoryServer)
{
// Since we've committed the changes we need to log any issues
// that this registration has caused
}
// When a new baseDN is registered with the server we have to create
// a new workflow to handle the base DN.
{
// Now create a workflow for the registered baseDN and register
// the workflow with the default network group, but don't register
// the workflow if the backend happens to be the configuration
// backend because it's too soon for the config backend.
}
}
}
/**
* 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 we need to 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 is not required to
* hold any locks on the specified DN.
*
* @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.
*/
{
{
}
}
/**
* 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;
}
// Ask the appropriate backend if the entry exists.
// If it is not appropriate for any backend, then return false.
}
/**
* 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 supported LDAP versions for the Directory Server.
*
* @return The supported LDAP versions for the Directory Server.
*/
{
}
/**
* Registers the provided LDAP protocol version as supported within the
* Directory Server.
*
* @param supportedLDAPVersion The LDAP protocol version to register as
* supported.
* @param connectionHandler The connection handler that supports the
* provided LDAP version. Note that multiple
* connection handlers can provide support for
* the same LDAP versions.
*/
public static synchronized void registerSupportedLDAPVersion(
int supportedLDAPVersion,
{
{
}
else
{
{
}
}
}
/**
* Deregisters the provided LDAP protocol version as supported within the
* Directory Server.
*
* @param supportedLDAPVersion The LDAP protocol version to deregister.
* @param connectionHandler The connection handler that no longer
* supports the provided LDAP version.
*/
public static synchronized void deregisterSupportedLDAPVersion(
int supportedLDAPVersion,
{
{
{
}
}
}
/**
* 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.
LocalizableMessage message = ERR_HOST_PORT_ALREADY_SPECIFIED.get(c.getConnectionHandlerName(), listener);
}
else
{
}
}
}
{
}
// If there are no connection handlers log a message.
if (connectionHandlers.isEmpty())
{
}
// At this point, we should be ready to go.
{
}
}
/**
* 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;
}
/**
* Runs all the necessary checks prior to adding an operation to the work
* queue. It throws a DirectoryException if one of the check fails.
*
* @param operation
* The operation to be added to the work queue.
* @throws DirectoryException
* If a check failed preventing the operation from being added to
* the queue
*/
throws DirectoryException
{
//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:
case EXTENDED:
{
}
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.
{
// 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.
}
}
}
/**
* 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
{
}
/**
* Tries to add the provided operation to the work queue if not full so that
* it will be processed by one of the worker threads.
*
* @param operation
* The operation to be added to the work queue.
* @return true if the operation could be enqueued, false otherwise
* @throws DirectoryException
* If a problem prevents the operation from being added to the queue
* (e.g., the queue is full).
*/
throws DirectoryException
{
}
/**
* 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.
*/
{
}
/**
* 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)
{
logger.traceException(e);
}
}
}
/**
* 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.
*/
{
{
try
{
}
catch (Exception e)
{
logger.traceException(e);
}
}
}
/**
* 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)
{
logger.traceException(e);
}
}
}
/**
* 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.
*/
{
{
try
{
}
catch (Exception e)
{
logger.traceException(e);
}
}
}
/**
* 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)
{
logger.traceException(e);
}
}
}
/**
* 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.
*/
public static void notifyExportEnded(Backend<?> backend, LDIFExportConfig config, boolean successful)
{
{
try
{
}
catch (Exception e)
{
logger.traceException(e);
}
}
}
/**
* 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)
{
logger.traceException(e);
}
}
}
/**
* 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.
*/
public static void notifyImportEnded(Backend<?> backend, LDIFImportConfig config, boolean successful)
{
{
try
{
}
catch (Exception e)
{
logger.traceException(e);
}
}
}
/**
* Registers the provided initialization completed listener with the
* Directory Server so that it will be notified when the server
* initialization completes.
*
* @param listener The initialization competed listener to register with
* the Directory Server.
*/
public static void registerInitializationCompletedListener(
}
/**
* Deregisters the provided initialization completed listener with the
* Directory Server.
*
* @param listener The initialization completed listener to deregister with
* the Directory Server.
*/
public static void deregisterInitializationCompletedListener(
}
/**
* 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;
}
// Send an alert notification that the server is shutting down.
// 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
{
}
catch (Exception e)
{
logger.traceException(e);
}
}
{
}
// shutdown replication
for (SynchronizationProvider provider :
{
}
// Call the shutdown plugins, and then finalize all the plugins defined in
// the server.
{
}
// Deregister the shutdown hook.
{
try
{
}
catch (Exception e) {}
}
// Notify all the shutdown listeners.
{
try
{
}
catch (Exception e)
{
logger.traceException(e);
}
}
// Shut down all of the alert handlers.
{
}
// Deregister all of the JMX MBeans.
{
{
if (o instanceof DirectoryServerMBean)
{
try
{
}
catch (Exception e)
{
logger.traceException(e);
}
}
}
}
// Finalize all of the SASL mechanism handlers.
for (SASLMechanismHandler handler :
{
try
{
}
catch (Exception e)
{
logger.traceException(e);
}
}
// Finalize all of the extended operation handlers.
for (ExtendedOperationHandler handler :
{
try
{
}
catch (Exception e)
{
logger.traceException(e);
}
}
// Finalize the password policy map.
{
}
// Finalize password policies and their config manager.
{
}
// Finalize the access control handler
if (accessControlHandler != null)
{
}
// Perform any necessary cleanup work for the group manager.
{
}
// Finalize the subentry manager.
{
}
// Shut down all the other components that may need special handling.
// NYI
// Shut down the monitor providers.
{
try
{
}
catch (Exception e)
{
logger.traceException(e);
}
}
// 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
{
{
logger.warn(WARN_SHUTDOWN_CANNOT_RELEASE_SHARED_BACKEND_LOCK, backend.getBackendID(), failureReason);
// FIXME -- Do we need to send an admin alert?
}
}
{
// FIXME -- Do we need to send an admin alert?
}
}
catch (Exception e)
{
logger.traceException(e);
}
}
// Finalize the entry cache.
{
}
// Release exclusive lock held on server.lock file
try {
}
} catch (Exception e) {
logger.traceException(e);
}
// 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.
// Now that the loggers are disabled we can shutdown the timer.
TimeThread.stop();
// 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;
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
* re-initialization 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
* re-initialization process.
*
* @throws InitializationException If a problem occurs while trying to
* initialize the config handler or
* bootstrap that server.
*/
throws InitializationException
{
// Ensure that the timer thread has started.
TimeThread.start();
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 number of 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
{
// Print extensions' extra information
if ( extensionInformation != null ) {
}
}
/**
* 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)
{
}
/**
* Specifies the maximum number of simultaneous persistent
* searches that are allowed.
*
* @param maxPSearches The maximum number of simultaneous persistent
* searches that are allowed.
*/
public static void setMaxPersistentSearchLimit(int maxPSearches)
{
}
/**
* Registers a new persistent search by increasing the count
* of active persistent searches. After receiving a persistent
* search request, a Local or Remote WFE must call this method to
* let the core server manage the count of concurrent persistent
* searches.
*/
public static void registerPersistentSearch()
{
}
/**
* Deregisters a canceled persistent search. After a persistent
* search is canceled, the handler must call this method to let
* the core server manage the count of concurrent persistent
* searches.
*/
public static void deregisterPersistentSearch()
{
}
/**
* Indicates whether a new persistent search is allowed.
*
* @return <CODE>true</CODE>if a new persistent search is allowed
* or <CODE>false</CODE>f if not.
*/
public static boolean allowNewPersistentSearch()
{
//-1 indicates that there is no limit.
}
/**
* 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)
{
}
/**
* Specifies whether to collect nanosecond resolution processing times for
* operations.
*
* @param useNanoTime <code>true</code> if nanosecond resolution times
* should be collected or <code>false</code> to
* only collect in millisecond resolution.
*/
public static void setUseNanoTime(boolean useNanoTime)
{
}
/**
* Retrieves whether operation processing times should be collected with
* nanosecond resolution.
*
* @return <code>true</code> if nanosecond resolution times are collected
* or <code>false</code> if only millisecond resolution times are
* being collected.
*/
public static boolean getUseNanoTime()
{
return directoryServer.useNanoTime;
}
/**
* 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);
}
}
/**
* Sets the message to be displayed on the command-line when the user asks for
* the usage.
* @param msg the message to be displayed on the command-line when the user
* asks for the usage.
*/
{
}
/**
* 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)
{
logger.traceException(e);
// 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 DirectoryServer.class.getName();
}
/**
* 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;
}
/**
* 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",
theToolDescription, false);
// Initialize all the command-line argument types and register them with the
// parser.
try
{
true, false, true,
.get());
configClass.setHidden(true);
true, false, true,
null,
.get());
configFile.setHidden(true);
"checkStartability",
checkStartability.setHidden(true);
"windowsNetStart",
windowsNetStart.setHidden(true);
.get());
fullVersion.setHidden(true);
"useLastKnownGoodConfig",
// Not used in this class, but required by the start-ds script
// (see issue #3814)
true, INFO_SECONDS_PLACEHOLDER.get(),
null, true, 0, false,
}
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,
// START_AS_DETACH_QUIET, START_AS_NON_DETACH_QUIET 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())
{
return;
}
else if (systemInfo.isPresent())
{
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)
{
logger.traceException(e);
}
serverLocked = true;
// Create an environment configuration for the server and populate a number
// of appropriate properties.
try
{
}
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.
+ stackTraceToSingleLineString(e));
}
// Configure the JVM to delete the PID file on exit, if it exists.
boolean pidFileMarkedForDeletion = false;
boolean startingFileMarkedForDeletion = false;
try
{
if (instanceRoot == 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
{
if (serverRoot == null)
{
"order to redirect standard output and standard error.");
}
else
{
+ "logs");
{
{
}
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));
}
// Install the default loggers so the startup messages
// will be printed.
// Bootstrap and start the Directory Server.
try
{
configFile.getValue());
}
catch (InitializationException ie)
{
}
catch (Exception e)
{
}
try
{
}
catch (InitializationException ie)
{
}
catch (ConfigException ce)
{
}
catch (Exception e)
{
}
if (startupDebugLogPublisher != null)
{
}
}
/**
* 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
{
// Get a complete DN which could be a tree naming schema
}
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
{
}
}
{
}
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 (OperatingSystem.isWindows())
{
}
else
{
isRunningAsWindowsService = false;
}
return isRunningAsWindowsService;
}
// TODO JNR remove error CoreMessages.ERR_REGISTER_WORKFLOW_ELEMENT_ALREADY_EXISTS
/**
* Print messages for start-ds "-F" option (full version information).
*/
private static void printFullVersionInformation() {
/*
* This option is used by the upgrade to identify the server build and it
* can eventually also be used to be sent to the support in case of an
* issue. Since this is not a public interface and since it is better
* to always have it in English for the support team, the message is
* not localized.
*/
if (BUILD_NUMBER > 0)
{
}
// Print extensions' extra information
if ( extensionInformation != null ) {
}
}
/**
* Sets the threshold capacity beyond which internal cached buffers used for
* encoding and decoding entries and protocol messages will be trimmed after
* use.
*
* @param maxInternalBufferSize
* The threshold capacity beyond which internal cached buffers used
* for encoding and decoding entries and protocol messages will be
* trimmed after use.
*/
public static void setMaxInternalBufferSize(int maxInternalBufferSize)
{
}
/**
* Returns the threshold capacity beyond which internal cached buffers used
* for encoding and decoding entries and protocol messages will be trimmed
* after use.
*
* @return The threshold capacity beyond which internal cached buffers used
* for encoding and decoding entries and protocol messages will be
* trimmed after use.
*/
public static int getMaxInternalBufferSize()
{
return directoryServer.maxInternalBufferSize;
}
}