Inline DirectoryServer.getConfigurationHandler()
| | |
| | | private void updateConfigEntryWithAttribute(DN entryDn, String attrName, List<DN> newBaseDNs) |
| | | throws DirectoryException, ConfigException |
| | | { |
| | | ConfigurationHandler configHandler = DirectoryServer.getConfigurationHandler(); |
| | | ConfigurationHandler configHandler = DirectoryServer.getInstance().getServerContext().getConfigurationHandler(); |
| | | final Entry configEntry = configHandler.getEntry(entryDn); |
| | | final Entry newEntry = LinkedHashMapEntry.deepCopyOfEntry(configEntry); |
| | | AttributeType attrType = Schema.getDefaultSchema().getAttributeType( |
| | |
| | | private void deleteBackend(BackendDescriptor backend) throws OpenDsException, ConfigException |
| | | { |
| | | DN dn = DN.valueOf("ds-cfg-backend-id" + "=" + backend.getBackendID() + ",cn=Backends,cn=config"); |
| | | Utilities.deleteConfigSubtree(DirectoryServer.getConfigurationHandler(), dn); |
| | | Utilities.deleteConfigSubtree(DirectoryServer.getInstance().getServerContext().getConfigurationHandler(), dn); |
| | | } |
| | | |
| | | /** |
| | |
| | | { |
| | | domainName.set(dName); |
| | | DN entryDN = domain.dn(); |
| | | Utilities.deleteConfigSubtree(DirectoryServer.getConfigurationHandler(), entryDN); |
| | | Utilities.deleteConfigSubtree(DirectoryServer.getInstance().getServerContext().getConfigurationHandler(), entryDN); |
| | | break; |
| | | } |
| | | } |
| | |
| | | { |
| | | dn = "ds-cfg-attribute" + "=" + index.getName() + ",cn=Index," + backendId + ",cn=Backends,cn=config"; |
| | | } |
| | | DirectoryServer.getConfigurationHandler().deleteEntry(DN.valueOf(dn)); |
| | | DirectoryServer.getInstance().getServerContext().getConfigurationHandler().deleteEntry(DN.valueOf(dn)); |
| | | } |
| | | |
| | | /** |
| | |
| | | { |
| | | // Read the configuration file. |
| | | DN dn = DN.valueOf("ds-cfg-backend-id" + "=" + backendName + ",cn=Backends,cn=config"); |
| | | Utilities.deleteConfigSubtree(DirectoryServer.getConfigurationHandler(), dn); |
| | | Utilities.deleteConfigSubtree(DirectoryServer.getInstance().getServerContext().getConfigurationHandler(), dn); |
| | | } |
| | | catch (OpenDsException | ConfigException ode) |
| | | { |
| | |
| | | throws ConfigException, InitializationException |
| | | { |
| | | final ConfigurationBackend configBackend = |
| | | new ConfigurationBackend(serverContext, DirectoryServer.getConfigurationHandler()); |
| | | new ConfigurationBackend(serverContext, DirectoryServer.getInstance().getServerContext().getConfigurationHandler()); |
| | | initializeBackend(configBackend, configBackend.getBackendCfg()); |
| | | |
| | | // Register add and delete listeners. |
| | |
| | | @Override |
| | | public String getInstanceRoot() |
| | | { |
| | | return DirectoryServer.getInstanceRoot(); |
| | | return directoryServer.environmentConfig.getInstanceRootAsString(); |
| | | } |
| | | |
| | | @Override |
| | | public String getServerRoot() |
| | | { |
| | | return DirectoryServer.getServerRoot(); |
| | | return directoryServer.environmentConfig.getServerRootAsString(); |
| | | } |
| | | |
| | | @Override |
| | |
| | | } |
| | | |
| | | @Override |
| | | public ConfigurationHandler getConfigurationHandler() |
| | | { |
| | | return directoryServer.configurationHandler; |
| | | } |
| | | |
| | | @Override |
| | | public DirectoryEnvironmentConfig getEnvironment() |
| | | { |
| | | return directoryServer.environmentConfig; |
| | |
| | | return directoryServer.operatingSystem; |
| | | } |
| | | |
| | | /** |
| | | * Retrieves a reference to the Directory Server configuration handler. |
| | | * |
| | | * @return A reference to the Directory Server configuration handler. |
| | | */ |
| | | public static ConfigurationHandler getConfigurationHandler() |
| | | { |
| | | return directoryServer.configurationHandler; |
| | | } |
| | | |
| | | private void initializePlugins(Set<PluginType> pluginTypes) |
| | | throws ConfigException, InitializationException |
| | | { |
| | |
| | | */ |
| | | public static String getServerRoot() |
| | | { |
| | | return directoryServer.environmentConfig.getServerRootAsString(); |
| | | return getInstance().getServerContext().getServerRoot(); |
| | | } |
| | | |
| | | /** |
| | |
| | | */ |
| | | public static String getInstanceRoot() |
| | | { |
| | | return directoryServer.environmentConfig.getInstanceRootAsString(); |
| | | return getInstance().getServerContext().getInstanceRoot(); |
| | | } |
| | | |
| | | /** |
| | |
| | | import org.forgerock.opendj.server.config.server.RootCfg; |
| | | import org.opends.server.api.KeyManagerProvider; |
| | | import org.opends.server.api.TrustManagerProvider; |
| | | import org.opends.server.config.ConfigurationHandler; |
| | | import org.opends.server.discovery.ServiceDiscoveryMechanismConfigManager; |
| | | import org.opends.server.extensions.DiskSpaceMonitor; |
| | | import org.opends.server.loggers.CommonAudit; |
| | |
| | | SchemaHandler getSchemaHandler(); |
| | | |
| | | /** |
| | | * Returns the configuration handler, which provides operations to the configuration. |
| | | * |
| | | * @return the configuration handler |
| | | */ |
| | | ConfigurationHandler getConfigurationHandler(); |
| | | |
| | | /** |
| | | * Returns the environment of the server. |
| | | * |
| | | * @return the environment |
| | |
| | | try |
| | | { |
| | | DN eclConfigEntryDN = DN.valueOf("cn=external changeLog," + config.dn()); |
| | | if (DirectoryServer.getConfigurationHandler().hasEntry(eclConfigEntryDN)) |
| | | if (DirectoryServer.getInstance().getServerContext().getConfigurationHandler().hasEntry(eclConfigEntryDN)) |
| | | { |
| | | DirectoryServer.getConfigurationHandler().deleteEntry(eclConfigEntryDN); |
| | | DirectoryServer.getInstance().getServerContext().getConfigurationHandler().deleteEntry(eclConfigEntryDN); |
| | | } |
| | | } |
| | | catch(Exception e) |
| | |
| | | try |
| | | { |
| | | DN configDn = config.dn(); |
| | | ConfigurationHandler configHandler = DirectoryServer.getConfigurationHandler(); |
| | | ConfigurationHandler configHandler = DirectoryServer.getInstance().getServerContext().getConfigurationHandler(); |
| | | if (configHandler.hasEntry(config.dn())) |
| | | { |
| | | try |
| | |
| | | // backends. |
| | | try |
| | | { |
| | | ConfigurationHandler configHandler = DirectoryServer.getConfigurationHandler(); |
| | | ConfigurationHandler configHandler = DirectoryServer.getInstance().getServerContext().getConfigurationHandler(); |
| | | for (DN childrenDn : configHandler.getChildren(backendBaseDN)) |
| | | { |
| | | // Get the backend ID attribute from the entry. If there isn't one, then |
| | |
| | | { |
| | | // Iterate through the immediate children, attempting to parse them as backends. |
| | | final RootCfg root = DirectoryServer.getInstance().getServerContext().getRootConfig(); |
| | | ConfigurationHandler configHandler = DirectoryServer.getConfigurationHandler(); |
| | | ConfigurationHandler configHandler = DirectoryServer.getInstance().getServerContext().getConfigurationHandler(); |
| | | final DN backendBaseDN = getBackendBaseDN(); |
| | | for (final DN childrenDn : configHandler.getChildren(backendBaseDN)) |
| | | { |
| | |
| | | final DN rootDN = parseRootDN(); |
| | | final String rootPW = parseRootDNPassword(); |
| | | |
| | | configHandler = DirectoryServer.getConfigurationHandler(); |
| | | configHandler = DirectoryServer.getInstance().getServerContext().getConfigurationHandler(); |
| | | |
| | | checkManagerProvider(keyManagerProviderDN, JCKES_KEY_MANAGER_DN, JCKES_KEY_MANAGER_LDIF_ENTRY, true); |
| | | checkManagerProvider(trustManagerProviderDN, JCKES_TRUST_MANAGER_DN, JCKES_TRUST_MANAGER_LDIF_ENTRY, false); |
| | |
| | | |
| | | // Iterate through the immediate children, attempting to parse them as backends. |
| | | Map<String, Set<DN>> backendMap = new TreeMap<>(); |
| | | ConfigurationHandler configHandler = DirectoryServer.getConfigurationHandler(); |
| | | ConfigurationHandler configHandler = DirectoryServer.getInstance().getServerContext().getConfigurationHandler(); |
| | | for (DN childrenDn : configHandler.getChildren(backendBaseDN)) |
| | | { |
| | | Entry configEntry = Converters.to(configHandler.getEntry(childrenDn)); |
| | |
| | | Entry ecle = DirectoryServer.getEntry(DN.valueOf("cn=external changelog," + synchroServerStringDN)); |
| | | if (ecle!=null) |
| | | { |
| | | DirectoryServer.getConfigurationHandler().deleteEntry(ecle.getName()); |
| | | DirectoryServer.getInstance().getServerContext().getConfigurationHandler().deleteEntry(ecle.getName()); |
| | | } |
| | | DirectoryServer.getConfigurationHandler().deleteEntry(synchroServerDN); |
| | | DirectoryServer.getInstance().getServerContext().getConfigurationHandler().deleteEntry(synchroServerDN); |
| | | assertNull(DirectoryServer.getEntry(synchroServerEntry.getName()), |
| | | "Unable to delete the synchronized domain"); |
| | | synchroServerEntry = null; |
| | |
| | | // @formatter:on |
| | | |
| | | // Configure replication domain |
| | | DirectoryServer.getConfigurationHandler().addEntry(Converters.from(repDomainEntry)); |
| | | DirectoryServer.getInstance().getServerContext().getConfigurationHandler().addEntry(Converters.from(repDomainEntry)); |
| | | assertNotNull(DirectoryServer.getEntry(repDomainEntry.getName()), |
| | | "Unable to add the synchronized server"); |
| | | configEntriesToCleanup.add(repDomainEntry.getName()); |
| | |
| | | { |
| | | if (configEntry != null) |
| | | { |
| | | DirectoryServer.getConfigurationHandler().addEntry(Converters.from(configEntry)); |
| | | DirectoryServer.getInstance().getServerContext().getConfigurationHandler().addEntry(Converters.from(configEntry)); |
| | | assertNotNull(DirectoryServer.getEntry(configEntry.getName()), errorMessage); |
| | | configEntriesToCleanup.add(configEntry.getName()); |
| | | } |
| | |
| | | Entry domainCfgEntry = TestCaseUtils.entryFromLdifString(configEntryLdif); |
| | | |
| | | // Add the config entry to create the replicated domain |
| | | DirectoryServer.getConfigurationHandler().addEntry(Converters.from(domainCfgEntry)); |
| | | DirectoryServer.getInstance().getServerContext().getConfigurationHandler().addEntry(Converters.from(domainCfgEntry)); |
| | | assertNotNull(DirectoryServer.getEntry(domainCfgEntry.getName()), |
| | | "Unable to add the domain config entry: " + configEntryLdif); |
| | | |
| | |
| | | // @formatter:on |
| | | |
| | | // Add the config entry to create the replicated domain |
| | | DirectoryServer.getConfigurationHandler().addEntry(Converters.from(domainCfgEntry)); |
| | | DirectoryServer.getInstance().getServerContext().getConfigurationHandler().addEntry(Converters.from(domainCfgEntry)); |
| | | assertNotNull(DirectoryServer.getEntry(domainCfgEntry.getName()), |
| | | "Unable to add the domain config entry: " + domainCfgEntry); |
| | | |
| | |
| | | fractionalDomainCfgEntry = TestCaseUtils.entryFromLdifString(configEntryLdif); |
| | | |
| | | // Add the config entry to create the replicated domain |
| | | DirectoryServer.getConfigurationHandler().addEntry(Converters.from(fractionalDomainCfgEntry)); |
| | | DirectoryServer.getInstance().getServerContext().getConfigurationHandler().addEntry(Converters.from(fractionalDomainCfgEntry)); |
| | | assertNotNull(DirectoryServer.getEntry(fractionalDomainCfgEntry.getName()), |
| | | "Unable to add the domain config entry: " + configEntryLdif); |
| | | } |