| | |
| | | */ |
| | | package org.opends.server.core; |
| | | |
| | | import static org.opends.messages.ConfigMessages.*; |
| | | import static org.opends.messages.CoreMessages.*; |
| | | import static org.opends.messages.ToolMessages.*; |
| | | import static org.opends.server.config.ConfigConstants.*; |
| | | import static org.opends.server.loggers.AccessLogger.*; |
| | | import static org.opends.server.loggers.ErrorLogger.*; |
| | | import static org.opends.server.loggers.debug.DebugLogger.*; |
| | | import static org.opends.server.schema.SchemaConstants.*; |
| | | import static org.opends.server.util.DynamicConstants.*; |
| | | import static org.opends.server.util.ServerConstants.*; |
| | | import static org.opends.server.util.StaticUtils.*; |
| | | import static org.opends.server.util.Validator.*; |
| | | |
| | | import java.io.*; |
| | | import java.lang.management.ManagementFactory; |
| | | import java.net.InetAddress; |
| | |
| | | import org.opends.server.workflowelement.WorkflowElementConfigManager; |
| | | import org.opends.server.workflowelement.localbackend.LocalBackendWorkflowElement; |
| | | |
| | | import static org.opends.messages.ConfigMessages.*; |
| | | import static org.opends.messages.CoreMessages.*; |
| | | import static org.opends.messages.ToolMessages.*; |
| | | import static org.opends.server.config.ConfigConstants.*; |
| | | import static org.opends.server.loggers.AccessLogger.*; |
| | | import static org.opends.server.loggers.ErrorLogger.*; |
| | | import static org.opends.server.loggers.debug.DebugLogger.*; |
| | | import static org.opends.server.schema.SchemaConstants.*; |
| | | import static org.opends.server.util.DynamicConstants.*; |
| | | import static org.opends.server.util.ServerConstants.*; |
| | | import static org.opends.server.util.StaticUtils.*; |
| | | import static org.opends.server.util.Validator.*; |
| | | |
| | | /** |
| | | * This class defines the core of the Directory Server. It manages the startup |
| | | * and shutdown processes and coordinates activities between all other |
| | |
| | | /** The set of backup task listeners registered with the Directory Server. */ |
| | | private CopyOnWriteArrayList<BackupTaskListener> backupTaskListeners; |
| | | |
| | | /** |
| | | * The set of change notification listeners registered with the Directory |
| | | * Server. |
| | | */ |
| | | private List<ChangeNotificationListener> |
| | | changeNotificationListeners; |
| | | |
| | | /** The set of connection handlers registered with the Directory Server. */ |
| | | private List<ConnectionHandler> connectionHandlers; |
| | | |
| | |
| | | directoryServer.backendInitializationListeners = |
| | | new CopyOnWriteArraySet<BackendInitializationListener>(); |
| | | directoryServer.baseDnRegistry = new BaseDnRegistry(); |
| | | directoryServer.changeNotificationListeners = |
| | | new CopyOnWriteArrayList<ChangeNotificationListener>(); |
| | | directoryServer.initializationCompletedListeners = |
| | | new CopyOnWriteArrayList<InitializationCompletedListener>(); |
| | | directoryServer.shutdownListeners = |
| | |
| | | new ConcurrentHashMap<String,ExtendedOperationHandler>(); |
| | | directoryServer.saslMechanismHandlers = |
| | | new ConcurrentHashMap<String,SASLMechanismHandler>(); |
| | | directoryServer.authenticatedUsers = new AuthenticatedUsers(); |
| | | directoryServer.offlineSchemaChanges = new LinkedList<Modification>(); |
| | | directoryServer.backupTaskListeners = |
| | | new CopyOnWriteArrayList<BackupTaskListener>(); |
| | |
| | | certificateMapperConfigManager.initializeCertificateMappers(); |
| | | |
| | | |
| | | // Initialize the identity mappers. |
| | | initializeIdentityMappers(); |
| | | |
| | | |
| | | // Initialize the root DNs. |
| | | rootDNConfigManager = new RootDNConfigManager(); |
| | | rootDNConfigManager.initializeRootDNs(); |
| | | |
| | | |
| | | // Initialize the subentry manager. |
| | | directoryServer.authenticatedUsers = new AuthenticatedUsers(); |
| | | // initialize both subentry manager and group manager for this backend. |
| | | initializeSubentryManager(); |
| | | |
| | | // Initialize the group manager. |
| | | initializeGroupManager(); |
| | | |
| | | // Now we can initialize both subentry manager and group manager |
| | | // for this backend. |
| | | subentryManager.performBackendInitializationProcessing(configHandler); |
| | | groupManager.performBackendInitializationProcessing(configHandler); |
| | | |
| | |
| | | // Reset the map as we can no longer guarantee offline state. |
| | | directoryServer.offlineBackendsStateIDs.clear(); |
| | | |
| | | // Initialize all the extended operation handlers. |
| | | initializeExtendedOperations(); |
| | | |
| | | |
| | | // Initialize all the SASL mechanism handlers. |
| | | initializeSASLMechanisms(); |
| | | |
| | | |
| | | // Initialize all the connection handlers |
| | | // (including the administration connector). |
| | | if (startConnectionHandlers) |
| | |
| | | initializeConnectionHandlers(); |
| | | } |
| | | |
| | | |
| | | // Initialize all the monitor providers. |
| | | monitorConfigManager = new MonitorConfigManager(); |
| | | monitorConfigManager.initializeMonitorProviders(); |
| | | |
| | | |
| | | // Initialize all the authentication policy components. |
| | | initializeAuthenticationPolicyComponents(); |
| | | |
| | | |
| | |
| | | return directoryServer.workQueue.trySubmitOperation(operation); |
| | | } |
| | | |
| | | |
| | | /** |
| | | * Retrieves the set of change notification listeners registered with the |
| | | * Directory Server. |
| | | * |
| | | * @return The set of change notification listeners registered with the |
| | | * Directory Server. |
| | | */ |
| | | public static List<ChangeNotificationListener> |
| | | getChangeNotificationListeners() |
| | | { |
| | | return directoryServer.changeNotificationListeners; |
| | | } |
| | | |
| | | |
| | | |
| | | /** |
| | | * Registers the provided change notification listener with the Directory |
| | | * Server so that it will be notified of any add, delete, modify, or modify DN |
| | | * operations that are performed. |
| | | * |
| | | * @param changeListener The change notification listener to register with |
| | | * the Directory Server. |
| | | */ |
| | | public static void registerChangeNotificationListener( |
| | | ChangeNotificationListener changeListener) |
| | | { |
| | | directoryServer.changeNotificationListeners.add(changeListener); |
| | | } |
| | | |
| | | |
| | | |
| | | /** |
| | | * Deregisters the provided change notification listener with the Directory |
| | | * Server so that it will no longer be notified of any add, delete, modify, or |
| | | * modify DN operations that are performed. |
| | | * |
| | | * @param changeListener The change notification listener to deregister with |
| | | * the Directory Server. |
| | | */ |
| | | public static void deregisterChangeNotificationListener( |
| | | ChangeNotificationListener changeListener) |
| | | { |
| | | directoryServer.changeNotificationListeners.remove(changeListener); |
| | | } |
| | | |
| | | |
| | | |
| | | /** |
| | | * Retrieves the set of synchronization providers that have been registered |
| | | * with the Directory Server. |