DirectoryServer.getConfigEntry(DN) => DirectoryServer.getEntry(DN)
| | |
| | | |
| | | import org.forgerock.i18n.LocalizableMessage; |
| | | import org.forgerock.i18n.slf4j.LocalizedLogger; |
| | | import org.forgerock.opendj.config.server.ConfigException; |
| | | import org.forgerock.opendj.ldap.ResultCode; |
| | | import org.opends.messages.Severity; |
| | | import org.opends.messages.TaskMessages; |
| | |
| | | Entry configEntry; |
| | | try |
| | | { |
| | | // Get the backend configuration entry. |
| | | configEntry = DirectoryServer.getConfigEntry(configEntryDN); |
| | | configEntry = DirectoryServer.getEntry(configEntryDN); |
| | | } |
| | | catch (ConfigException e) |
| | | catch (DirectoryException e) |
| | | { |
| | | logger.traceException(e); |
| | | logger.error(ERR_RESTOREDB_NO_BACKENDS_FOR_DN, backupDirectory, configEntryDN); |
| | | return TaskState.STOPPED_BY_ERROR; |
| | | } |
| | | |
| | | // Get the backend ID from the configuration entry. |
| | | String backendID = TaskUtils.getBackendID(configEntry); |
| | | |
| | | // Get the backend. |
| | | Backend<?> backend = DirectoryServer.getBackend(backendID); |
| | | if (!backend.supports(BackendOperation.RESTORE)) |
| | | { |
| | |
| | | import java.util.Set; |
| | | |
| | | import org.forgerock.i18n.LocalizableMessage; |
| | | import org.forgerock.opendj.config.server.ConfigException; |
| | | import org.forgerock.opendj.ldap.DN; |
| | | import org.forgerock.opendj.ldap.ResultCode; |
| | | import org.forgerock.opendj.ldap.schema.AttributeType; |
| | |
| | | } |
| | | |
| | | /** |
| | | * 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. |
| | | */ |
| | | public static Entry getConfigEntry(DN entryDN) |
| | | throws ConfigException |
| | | { |
| | | return DirectoryServer.getConfigEntry(entryDN); |
| | | } |
| | | |
| | | |
| | | |
| | | /** |
| | | * Retrieves the path to the root directory for this instance of the |
| | | * Directory Server. |
| | | * |
| | |
| | | |
| | | if (configDNString != null) |
| | | { |
| | | configEntry = DirectoryServer.getConfigEntry(DN.valueOf(configDNString)); |
| | | configEntry = DirectoryServer.getEntry(DN.valueOf(configDNString)); |
| | | } |
| | | } |
| | | |
| | |
| | | public void testDefaultConfiguration() |
| | | throws Exception |
| | | { |
| | | DN dn = DN.valueOf("cn=Random Password Generator,cn=Password Generators," + |
| | | "cn=config"); |
| | | Entry configEntry = DirectoryServer.getConfigEntry(dn); |
| | | Entry configEntry = DirectoryServer.getEntry( |
| | | DN.valueOf("cn=Random Password Generator,cn=Password Generators,cn=config")); |
| | | assertNotNull(configEntry); |
| | | |
| | | RandomPasswordGenerator generator = InitializationUtils.initializePasswordGenerator( |
| | |
| | | protected GenericMonitorTestCase(String dnString) |
| | | throws Exception |
| | | { |
| | | super(); |
| | | |
| | | TestCaseUtils.startServer(); |
| | | |
| | | if (dnString != null) |
| | | { |
| | | DN dn = DN.valueOf(dnString); |
| | | configEntry = DirectoryServer.getConfigEntry(dn); |
| | | configEntry = DirectoryServer.getEntry(DN.valueOf(dnString)); |
| | | assertNotNull(configEntry); |
| | | } |
| | | } |
| | |
| | | |
| | | DN synchroServerDN = DN.valueOf(synchroServerStringDN); |
| | | |
| | | Entry ecle = DirectoryServer.getConfigEntry(DN.valueOf("cn=external changelog," + synchroServerStringDN)); |
| | | Entry ecle = DirectoryServer.getEntry(DN.valueOf("cn=external changelog," + synchroServerStringDN)); |
| | | if (ecle!=null) |
| | | { |
| | | DirectoryServer.getConfigurationHandler().deleteEntry(ecle.getName()); |
| | | } |
| | | DirectoryServer.getConfigurationHandler().deleteEntry(synchroServerDN); |
| | | assertNull(DirectoryServer.getConfigEntry(synchroServerEntry.getName()), |
| | | assertNull(DirectoryServer.getEntry(synchroServerEntry.getName()), |
| | | "Unable to delete the synchronized domain"); |
| | | synchroServerEntry = null; |
| | | |
| | |
| | | |
| | | // Configure replication domain |
| | | DirectoryServer.getConfigurationHandler().addEntry(Converters.from(repDomainEntry)); |
| | | assertNotNull(DirectoryServer.getConfigEntry(repDomainEntry.getName()), |
| | | assertNotNull(DirectoryServer.getEntry(repDomainEntry.getName()), |
| | | "Unable to add the synchronized server"); |
| | | configEntriesToCleanup.add(repDomainEntry.getName()); |
| | | |
| | |
| | | if (configEntry != null) |
| | | { |
| | | DirectoryServer.getConfigurationHandler().addEntry(Converters.from(configEntry)); |
| | | assertNotNull(DirectoryServer.getConfigEntry(configEntry.getName()), errorMessage); |
| | | assertNotNull(DirectoryServer.getEntry(configEntry.getName()), errorMessage); |
| | | configEntriesToCleanup.add(configEntry.getName()); |
| | | } |
| | | } |
| | |
| | | |
| | | // Add the config entry to create the replicated domain |
| | | DirectoryServer.getConfigurationHandler().addEntry(Converters.from(domainCfgEntry)); |
| | | assertNotNull(DirectoryServer.getConfigEntry(domainCfgEntry.getName()), |
| | | assertNotNull(DirectoryServer.getEntry(domainCfgEntry.getName()), |
| | | "Unable to add the domain config entry: " + configEntryLdif); |
| | | |
| | | return domainCfgEntry; |
| | |
| | | |
| | | // Add the config entry to create the replicated domain |
| | | DirectoryServer.getConfigurationHandler().addEntry(Converters.from(domainCfgEntry)); |
| | | assertNotNull(DirectoryServer.getConfigEntry(domainCfgEntry.getName()), |
| | | assertNotNull(DirectoryServer.getEntry(domainCfgEntry.getName()), |
| | | "Unable to add the domain config entry: " + configEntryLdif); |
| | | |
| | | return domainCfgEntry; |
| | |
| | | |
| | | // Add the config entry to create the replicated domain |
| | | DirectoryServer.getConfigurationHandler().addEntry(Converters.from(fractionalDomainCfgEntry)); |
| | | assertNotNull(DirectoryServer.getConfigEntry(fractionalDomainCfgEntry.getName()), |
| | | assertNotNull(DirectoryServer.getEntry(fractionalDomainCfgEntry.getName()), |
| | | "Unable to add the domain config entry: " + configEntryLdif); |
| | | } |
| | | } |
| | |
| | | { |
| | | ByteString bytePassword = ByteString.valueOfUtf8(password); |
| | | |
| | | Entry configEntry = |
| | | DirectoryServer.getConfigEntry( |
| | | Entry configEntry = DirectoryServer.getEntry( |
| | | DN.valueOf("cn=Salted MD5,cn=Password Storage Schemes,cn=config")); |
| | | |
| | | SaltedMD5PasswordStorageScheme scheme = InitializationUtils.initializePasswordStorageScheme( |
| | |
| | | { |
| | | ByteString bytePassword = ByteString.valueOfUtf8(password); |
| | | |
| | | Entry configEntry = DirectoryServer.getConfigEntry( |
| | | Entry configEntry = DirectoryServer.getEntry( |
| | | DN.valueOf("cn=Salted MD5,cn=Password Storage Schemes,cn=config")); |
| | | |
| | | SaltedMD5PasswordStorageScheme scheme = InitializationUtils.initializePasswordStorageScheme( |