| | |
| | | import org.opends.server.util.TimeThread; |
| | | |
| | | import static org.opends.server.config.ConfigConstants.*; |
| | | import static org.opends.server.loggers.Debug.*; |
| | | import static org.opends.server.loggers.debug.DebugLogger.debugCought; |
| | | import static org.opends.server.loggers.debug.DebugLogger.debugEnabled; |
| | | import org.opends.server.types.DebugLogLevel; |
| | | import static org.opends.server.loggers.Error.*; |
| | | import static org.opends.server.messages.ConfigMessages.*; |
| | | import static org.opends.server.messages.MessageHandler.*; |
| | |
| | | implements AlertGenerator |
| | | { |
| | | /** |
| | | * The fully-qualified name of this class for debugging purposes. |
| | | * The fully-qualified name of this class. |
| | | */ |
| | | private static final String CLASS_NAME = |
| | | "org.opends.server.extensions.ConfigFileHandler"; |
| | |
| | | { |
| | | super(); |
| | | |
| | | assert debugConstructor(CLASS_NAME); |
| | | } |
| | | |
| | | |
| | |
| | | public void initializeConfigHandler(String configFile, boolean checkSchema) |
| | | throws InitializationException |
| | | { |
| | | assert debugEnter(CLASS_NAME, "initializeConfigHandler", |
| | | String.valueOf(configFile)); |
| | | |
| | | |
| | | // Initialize the config lock. |
| | |
| | | } |
| | | catch (InitializationException ie) |
| | | { |
| | | assert debugException(CLASS_NAME, "initializeConfigHandler", ie); |
| | | if (debugEnabled()) |
| | | { |
| | | debugCought(DebugLogLevel.ERROR, ie); |
| | | } |
| | | |
| | | throw ie; |
| | | } |
| | | catch (Exception e) |
| | | { |
| | | assert debugException(CLASS_NAME, "initializeConfigHandler", e); |
| | | if (debugEnabled()) |
| | | { |
| | | debugCought(DebugLogLevel.ERROR, e); |
| | | } |
| | | |
| | | int msgID = MSGID_CONFIG_FILE_CANNOT_VERIFY_EXISTENCE; |
| | | String message = getMessage(msgID, configFile, String.valueOf(e)); |
| | |
| | | } |
| | | catch (Exception e) |
| | | { |
| | | assert debugException(CLASS_NAME, "initializeConfigHandler", e); |
| | | if (debugEnabled()) |
| | | { |
| | | debugCought(DebugLogLevel.ERROR, e); |
| | | } |
| | | |
| | | int msgID = MSGID_CONFIG_UNABLE_TO_APPLY_STARTUP_CHANGES; |
| | | String message = getMessage(msgID, changesFile.getAbsolutePath(), |
| | |
| | | } |
| | | catch (Exception e) |
| | | { |
| | | assert debugException(CLASS_NAME, "initializeConfigHandler", e); |
| | | if (debugEnabled()) |
| | | { |
| | | debugCought(DebugLogLevel.ERROR, e); |
| | | } |
| | | |
| | | int msgID = MSGID_CONFIG_FILE_CANNOT_OPEN_FOR_READ; |
| | | String message = getMessage(msgID, configFile, String.valueOf(e)); |
| | |
| | | } |
| | | catch (LDIFException le) |
| | | { |
| | | assert debugException(CLASS_NAME, "initializeConfigHandler", le); |
| | | if (debugEnabled()) |
| | | { |
| | | debugCought(DebugLogLevel.ERROR, le); |
| | | } |
| | | |
| | | try |
| | | { |
| | |
| | | } |
| | | catch (Exception e) |
| | | { |
| | | assert debugException(CLASS_NAME, "initializeConfigHandler", e); |
| | | if (debugEnabled()) |
| | | { |
| | | debugCought(DebugLogLevel.ERROR, e); |
| | | } |
| | | } |
| | | |
| | | int msgID = MSGID_CONFIG_FILE_INVALID_LDIF_ENTRY; |
| | |
| | | } |
| | | catch (Exception e) |
| | | { |
| | | assert debugException(CLASS_NAME, "initializeConfigHandler", e); |
| | | if (debugEnabled()) |
| | | { |
| | | debugCought(DebugLogLevel.ERROR, e); |
| | | } |
| | | |
| | | try |
| | | { |
| | |
| | | } |
| | | catch (Exception e2) |
| | | { |
| | | assert debugException(CLASS_NAME, "initializeConfigHandler", e2); |
| | | if (debugEnabled()) |
| | | { |
| | | debugCought(DebugLogLevel.ERROR, e2); |
| | | } |
| | | } |
| | | |
| | | int msgID = MSGID_CONFIG_FILE_READ_ERROR; |
| | |
| | | } |
| | | catch (Exception e) |
| | | { |
| | | assert debugException(CLASS_NAME, "initializeConfigHandler", e); |
| | | if (debugEnabled()) |
| | | { |
| | | debugCought(DebugLogLevel.ERROR, e); |
| | | } |
| | | } |
| | | |
| | | int msgID = MSGID_CONFIG_FILE_EMPTY; |
| | |
| | | } |
| | | catch (InitializationException ie) |
| | | { |
| | | assert debugException(CLASS_NAME, "initializeConfigHandler", ie); |
| | | if (debugEnabled()) |
| | | { |
| | | debugCought(DebugLogLevel.ERROR, ie); |
| | | } |
| | | |
| | | try |
| | | { |
| | |
| | | } |
| | | catch (Exception e) |
| | | { |
| | | assert debugException(CLASS_NAME, "initializeConfigHandler", e); |
| | | if (debugEnabled()) |
| | | { |
| | | debugCought(DebugLogLevel.ERROR, e); |
| | | } |
| | | } |
| | | |
| | | throw ie; |
| | | } |
| | | catch (Exception e) |
| | | { |
| | | assert debugException(CLASS_NAME, "initializeConfigHandler", e); |
| | | if (debugEnabled()) |
| | | { |
| | | debugCought(DebugLogLevel.ERROR, e); |
| | | } |
| | | |
| | | try |
| | | { |
| | |
| | | } |
| | | catch (Exception e2) |
| | | { |
| | | assert debugException(CLASS_NAME, "initializeConfigHandler", e2); |
| | | if (debugEnabled()) |
| | | { |
| | | debugCought(DebugLogLevel.ERROR, e2); |
| | | } |
| | | } |
| | | |
| | | // This should not happen, so we can use a generic error here. |
| | |
| | | } |
| | | catch (LDIFException le) |
| | | { |
| | | assert debugException(CLASS_NAME, "initializeConfigHandler", le); |
| | | if (debugEnabled()) |
| | | { |
| | | debugCought(DebugLogLevel.ERROR, le); |
| | | } |
| | | |
| | | try |
| | | { |
| | |
| | | } |
| | | catch (Exception e) |
| | | { |
| | | assert debugException(CLASS_NAME, "initializeConfigHandler", e); |
| | | if (debugEnabled()) |
| | | { |
| | | debugCought(DebugLogLevel.ERROR, e); |
| | | } |
| | | } |
| | | |
| | | int msgID = MSGID_CONFIG_FILE_INVALID_LDIF_ENTRY; |
| | |
| | | } |
| | | catch (Exception e) |
| | | { |
| | | assert debugException(CLASS_NAME, "initializeConfigHandler", e); |
| | | if (debugEnabled()) |
| | | { |
| | | debugCought(DebugLogLevel.ERROR, e); |
| | | } |
| | | |
| | | try |
| | | { |
| | |
| | | } |
| | | catch (Exception e2) |
| | | { |
| | | assert debugException(CLASS_NAME, "initializeConfigHandler", e2); |
| | | if (debugEnabled()) |
| | | { |
| | | debugCought(DebugLogLevel.ERROR, e2); |
| | | } |
| | | } |
| | | |
| | | int msgID = MSGID_CONFIG_FILE_READ_ERROR; |
| | |
| | | } |
| | | catch (Exception e) |
| | | { |
| | | assert debugException(CLASS_NAME, "initializeConfigHandler", e); |
| | | if (debugEnabled()) |
| | | { |
| | | debugCought(DebugLogLevel.ERROR, e); |
| | | } |
| | | } |
| | | |
| | | break; |
| | |
| | | } |
| | | catch (Exception e) |
| | | { |
| | | assert debugException(CLASS_NAME, "initializeConfigHandler", e); |
| | | if (debugEnabled()) |
| | | { |
| | | debugCought(DebugLogLevel.ERROR, e); |
| | | } |
| | | } |
| | | |
| | | int msgID = MSGID_CONFIG_FILE_DUPLICATE_ENTRY; |
| | |
| | | } |
| | | catch (Exception e) |
| | | { |
| | | assert debugException(CLASS_NAME, "initializeConfigHandler", e); |
| | | if (debugEnabled()) |
| | | { |
| | | debugCought(DebugLogLevel.ERROR, e); |
| | | } |
| | | } |
| | | |
| | | int msgID = MSGID_CONFIG_FILE_UNKNOWN_PARENT; |
| | |
| | | } |
| | | catch (Exception e) |
| | | { |
| | | assert debugException(CLASS_NAME, "initializeConfigHandler", e); |
| | | if (debugEnabled()) |
| | | { |
| | | debugCought(DebugLogLevel.ERROR, e); |
| | | } |
| | | } |
| | | |
| | | int msgID = MSGID_CONFIG_FILE_NO_PARENT; |
| | |
| | | catch (Exception e) |
| | | { |
| | | // This should not happen. |
| | | assert debugException(CLASS_NAME, "initializeConfigHandler", e); |
| | | if (debugEnabled()) |
| | | { |
| | | debugCought(DebugLogLevel.ERROR, e); |
| | | } |
| | | |
| | | try |
| | | { |
| | |
| | | } |
| | | catch (Exception e2) |
| | | { |
| | | assert debugException(CLASS_NAME, "initializeConfigHandler", e2); |
| | | if (debugEnabled()) |
| | | { |
| | | debugCought(DebugLogLevel.ERROR, e2); |
| | | } |
| | | } |
| | | |
| | | int msgID = MSGID_CONFIG_FILE_GENERIC_ERROR; |
| | |
| | | } |
| | | catch (Exception e) |
| | | { |
| | | assert debugException(CLASS_NAME, "initializeConfigHandler", e); |
| | | if (debugEnabled()) |
| | | { |
| | | debugCought(DebugLogLevel.ERROR, e); |
| | | } |
| | | |
| | | int msgID = MSGID_CONFIG_CANNOT_DETERMINE_SERVER_ROOT; |
| | | String message = getMessage(msgID, ENV_VAR_INSTANCE_ROOT); |
| | |
| | | } |
| | | catch (InitializationException ie) |
| | | { |
| | | assert debugException(CLASS_NAME, "initializeConfigHandler", ie); |
| | | if (debugEnabled()) |
| | | { |
| | | debugCought(DebugLogLevel.ERROR, ie); |
| | | } |
| | | |
| | | throw ie; |
| | | } |
| | | catch (Exception e) |
| | | { |
| | | assert debugException(CLASS_NAME, "initializeConfigHandler", e); |
| | | if (debugEnabled()) |
| | | { |
| | | debugCought(DebugLogLevel.ERROR, e); |
| | | } |
| | | |
| | | int msgID = MSGID_CONFIG_CANNOT_DETERMINE_SERVER_ROOT; |
| | | String message = getMessage(msgID, ENV_VAR_INSTANCE_ROOT); |
| | |
| | | } |
| | | catch (Exception e) |
| | | { |
| | | assert debugException(CLASS_NAME, "initializeConfigHandler", e); |
| | | if (debugEnabled()) |
| | | { |
| | | debugCought(DebugLogLevel.ERROR, e); |
| | | } |
| | | |
| | | int msgID = MSGID_CONFIG_CANNOT_REGISTER_AS_PRIVATE_SUFFIX; |
| | | String message = getMessage(msgID, configRootEntry.getDN(), |
| | |
| | | private void applyChangesFile(File sourceFile, File changesFile) |
| | | throws IOException, LDIFException |
| | | { |
| | | assert debugEnter(CLASS_NAME, "applyChangesFile", |
| | | String.valueOf(sourceFile), String.valueOf(changesFile)); |
| | | |
| | | |
| | | // FIXME -- Do we need to do anything special for configuration archiving? |
| | |
| | | sourceFile.renameTo(oldSource); |
| | | new File(tempFile).renameTo(sourceFile); |
| | | |
| | | |
| | | // Move the changes file out of the way so it doesn't get applied again. |
| | | File newChanges = new File(changesFile.getAbsolutePath() + ".applied"); |
| | | if (newChanges.exists()) |
| | |
| | | */ |
| | | public void finalizeConfigHandler() |
| | | { |
| | | assert debugEnter(CLASS_NAME, "finalizeConfigHandler"); |
| | | |
| | | try |
| | | { |
| | |
| | | } |
| | | catch (Exception e) |
| | | { |
| | | assert debugException(CLASS_NAME, "finalizeConfigHandler", e); |
| | | if (debugEnabled()) |
| | | { |
| | | debugCought(DebugLogLevel.ERROR, e); |
| | | } |
| | | } |
| | | } |
| | | |
| | |
| | | public ConfigEntry getConfigRootEntry() |
| | | throws ConfigException |
| | | { |
| | | assert debugEnter(CLASS_NAME, "getConfigRootEntry"); |
| | | |
| | | return configRootEntry; |
| | | } |
| | |
| | | public ConfigEntry getConfigEntry(DN entryDN) |
| | | throws ConfigException |
| | | { |
| | | assert debugEnter(CLASS_NAME, "getConfigEntry", String.valueOf(entryDN)); |
| | | |
| | | return configEntries.get(entryDN); |
| | | } |
| | |
| | | */ |
| | | public String getServerRoot() |
| | | { |
| | | assert debugEnter(CLASS_NAME, "getServerRoot"); |
| | | |
| | | return serverRoot; |
| | | } |
| | |
| | | public void initializeBackend(ConfigEntry configEntry, DN[] baseDNs) |
| | | throws ConfigException, InitializationException |
| | | { |
| | | assert debugEnter(CLASS_NAME, "initializeBackend", |
| | | String.valueOf(configEntry)); |
| | | |
| | | // No action is required, since all initialization was performed in the |
| | | // initializeConfigHandler method. |
| | |
| | | */ |
| | | public DN[] getBaseDNs() |
| | | { |
| | | assert debugEnter(CLASS_NAME, "getBaseDNs"); |
| | | |
| | | return baseDNs; |
| | | } |
| | |
| | | */ |
| | | public long getEntryCount() |
| | | { |
| | | assert debugEnter(CLASS_NAME, "getEntryCount"); |
| | | |
| | | return configEntries.size(); |
| | | } |
| | |
| | | */ |
| | | public boolean isLocal() |
| | | { |
| | | assert debugEnter(CLASS_NAME, "isLocal"); |
| | | |
| | | // The configuration information will always be local. |
| | | return true; |
| | |
| | | public Entry getEntry(DN entryDN) |
| | | throws DirectoryException |
| | | { |
| | | assert debugEnter(CLASS_NAME, "getEntry", String.valueOf(entryDN)); |
| | | |
| | | ConfigEntry configEntry = configEntries.get(entryDN); |
| | | if (configEntry == null) |
| | |
| | | public boolean entryExists(DN entryDN) |
| | | throws DirectoryException |
| | | { |
| | | assert debugEnter(CLASS_NAME, "entryExists", String.valueOf(entryDN)); |
| | | |
| | | return configEntries.containsKey(entryDN); |
| | | } |
| | |
| | | public void addEntry(Entry entry, AddOperation addOperation) |
| | | throws DirectoryException |
| | | { |
| | | assert debugEnter(CLASS_NAME, "addEntry", String.valueOf(entry), |
| | | String.valueOf(addOperation)); |
| | | |
| | | |
| | | // If there is an add operation, then make sure that the associated user has |
| | |
| | | } |
| | | catch (ConfigException ce) |
| | | { |
| | | assert debugException(CLASS_NAME, "addEntry", ce); |
| | | if (debugEnabled()) |
| | | { |
| | | debugCought(DebugLogLevel.ERROR, ce); |
| | | } |
| | | |
| | | int msgID = MSGID_CONFIG_FILE_ADD_FAILED; |
| | | String message = getMessage(msgID, String.valueOf(entryDN), |
| | |
| | | public void deleteEntry(DN entryDN, DeleteOperation deleteOperation) |
| | | throws DirectoryException |
| | | { |
| | | assert debugEnter(CLASS_NAME, "deleteEntry", String.valueOf(entryDN), |
| | | String.valueOf(deleteOperation)); |
| | | |
| | | |
| | | // If there is a delete operation, then make sure that the associated user |
| | |
| | | } |
| | | catch (ConfigException ce) |
| | | { |
| | | assert debugException(CLASS_NAME, "deleteEntry", ce); |
| | | if (debugEnabled()) |
| | | { |
| | | debugCought(DebugLogLevel.ERROR, ce); |
| | | } |
| | | |
| | | int msgID = MSGID_CONFIG_FILE_DELETE_FAILED; |
| | | String message = getMessage(msgID, String.valueOf(entryDN), |
| | |
| | | public void replaceEntry(Entry entry, ModifyOperation modifyOperation) |
| | | throws DirectoryException |
| | | { |
| | | assert debugEnter(CLASS_NAME, "replaceEntry", String.valueOf(entry), |
| | | String.valueOf(modifyOperation)); |
| | | |
| | | |
| | | // If there is a modify operation, then make sure that the associated user |
| | |
| | | ModifyDNOperation modifyDNOperation) |
| | | throws DirectoryException |
| | | { |
| | | assert debugEnter(CLASS_NAME, "renameEntry", String.valueOf(currentDN), |
| | | String.valueOf(entry), String.valueOf(modifyDNOperation)); |
| | | |
| | | |
| | | // If there is a modify DN operation, then make sure that the associated |
| | |
| | | public void search(SearchOperation searchOperation) |
| | | throws DirectoryException |
| | | { |
| | | assert debugEnter(CLASS_NAME, "search", String.valueOf(searchOperation)); |
| | | |
| | | |
| | | // Make sure that the associated user has the CONFIG_READ privilege. |
| | |
| | | SearchOperation searchOperation) |
| | | throws DirectoryException |
| | | { |
| | | assert debugEnter(CLASS_NAME, "searchSubtree", String.valueOf(baseEntry), |
| | | String.valueOf(filter), String.valueOf(searchOperation)); |
| | | |
| | | Entry e = baseEntry.getEntry(); |
| | | if (filter.matchesEntry(e)) |
| | |
| | | public void writeUpdatedConfig() |
| | | throws DirectoryException |
| | | { |
| | | assert debugEnter(CLASS_NAME, "writeUpdatedConfig"); |
| | | |
| | | |
| | | // FIXME -- This needs support for encryption. |
| | |
| | | } |
| | | catch (Exception e) |
| | | { |
| | | assert debugException(CLASS_NAME, "writeUpdatedConfig", e); |
| | | if (debugEnabled()) |
| | | { |
| | | debugCought(DebugLogLevel.ERROR, e); |
| | | } |
| | | |
| | | int msgID = MSGID_CONFIG_FILE_CANNOT_CREATE_ARCHIVE_DIR; |
| | | String message = getMessage(msgID, archiveDirectory.getAbsolutePath(), |
| | |
| | | } |
| | | catch (Exception e) |
| | | { |
| | | assert debugException(CLASS_NAME, "writeUpdatedConfig", e); |
| | | if (debugEnabled()) |
| | | { |
| | | debugCought(DebugLogLevel.ERROR, e); |
| | | } |
| | | |
| | | int msgID = MSGID_CONFIG_FILE_CANNOT_WRITE_CONFIG_ARCHIVE; |
| | | String message = getMessage(msgID, stackTraceToSingleLineString(e)); |
| | |
| | | } |
| | | catch (Exception e) |
| | | { |
| | | assert debugException(CLASS_NAME, "writeUpdatedConfig", e); |
| | | if (debugEnabled()) |
| | | { |
| | | debugCought(DebugLogLevel.ERROR, e); |
| | | } |
| | | |
| | | int msgID = MSGID_CONFIG_FILE_CANNOT_WRITE_CONFIG_ARCHIVE; |
| | | String message = getMessage(msgID, stackTraceToSingleLineString(e)); |
| | |
| | | } |
| | | catch (Exception e) |
| | | { |
| | | assert debugException(CLASS_NAME, "writeUpdatedConfig", e); |
| | | if (debugEnabled()) |
| | | { |
| | | debugCought(DebugLogLevel.ERROR, e); |
| | | } |
| | | |
| | | int msgID = MSGID_CONFIG_FILE_WRITE_CANNOT_EXPORT_NEW_CONFIG; |
| | | String message = getMessage(msgID, String.valueOf(tempConfig), |
| | |
| | | } |
| | | catch (Exception e) |
| | | { |
| | | assert debugException(CLASS_NAME, "writeUpdatedConfig", e); |
| | | if (debugEnabled()) |
| | | { |
| | | debugCought(DebugLogLevel.ERROR, e); |
| | | } |
| | | |
| | | int msgID = MSGID_CONFIG_FILE_WRITE_CANNOT_RENAME_NEW_CONFIG; |
| | | String message = getMessage(msgID, String.valueOf(tempConfig), |
| | |
| | | */ |
| | | public boolean supportsLDIFExport() |
| | | { |
| | | assert debugEnter(CLASS_NAME, "supportsLDIFExport"); |
| | | |
| | | return true; |
| | | } |
| | |
| | | LDIFExportConfig exportConfig) |
| | | throws DirectoryException |
| | | { |
| | | assert debugEnter(CLASS_NAME, "exportLDIF", String.valueOf(exportConfig)); |
| | | |
| | | LDIFWriter writer; |
| | | try |
| | |
| | | } |
| | | catch (Exception e) |
| | | { |
| | | assert debugException(CLASS_NAME, "exportLDIF", e); |
| | | if (debugEnabled()) |
| | | { |
| | | debugCought(DebugLogLevel.ERROR, e); |
| | | } |
| | | |
| | | int msgID = MSGID_CONFIG_LDIF_WRITE_ERROR; |
| | | String message = getMessage(msgID, String.valueOf(e)); |
| | |
| | | } |
| | | catch (Exception e) |
| | | { |
| | | assert debugException(CLASS_NAME, "exportLDIF", e); |
| | | if (debugEnabled()) |
| | | { |
| | | debugCought(DebugLogLevel.ERROR, e); |
| | | } |
| | | |
| | | int msgID = MSGID_CONFIG_FILE_CLOSE_ERROR; |
| | | String message = getMessage(msgID, String.valueOf(e)); |
| | |
| | | private void writeEntryAndChildren(LDIFWriter writer, ConfigEntry configEntry) |
| | | throws DirectoryException |
| | | { |
| | | assert debugEnter(CLASS_NAME, "writeEntryAndChildren", |
| | | String.valueOf(writer), String.valueOf(configEntry)); |
| | | |
| | | try |
| | | { |
| | |
| | | } |
| | | catch (Exception e) |
| | | { |
| | | assert debugException(CLASS_NAME, "writeEntryAndChildren", e); |
| | | if (debugEnabled()) |
| | | { |
| | | debugCought(DebugLogLevel.ERROR, e); |
| | | } |
| | | |
| | | int msgID = MSGID_CONFIG_FILE_WRITE_ERROR; |
| | | String message = getMessage(msgID, configEntry.getDN().toString(), |
| | |
| | | */ |
| | | public boolean supportsLDIFImport() |
| | | { |
| | | assert debugEnter(CLASS_NAME, "supportsLDIFImport"); |
| | | |
| | | return false; |
| | | } |
| | |
| | | LDIFImportConfig importConfig) |
| | | throws DirectoryException |
| | | { |
| | | assert debugEnter(CLASS_NAME, "importLDIF", String.valueOf(importConfig)); |
| | | |
| | | int msgID = MSGID_CONFIG_FILE_UNWILLING_TO_IMPORT; |
| | | String message = getMessage(msgID); |
| | |
| | | */ |
| | | public boolean supportsBackup() |
| | | { |
| | | assert debugEnter(CLASS_NAME, "supportsBackup"); |
| | | |
| | | // We do support an online backup mechanism for the configuration. |
| | | return true; |
| | |
| | | public boolean supportsBackup(BackupConfig backupConfig, |
| | | StringBuilder unsupportedReason) |
| | | { |
| | | assert debugEnter(CLASS_NAME, "supportsBackup"); |
| | | |
| | | |
| | | // We should support online backup for the configuration in any form. This |
| | |
| | | public void createBackup(ConfigEntry configEntry, BackupConfig backupConfig) |
| | | throws DirectoryException |
| | | { |
| | | assert debugEnter(CLASS_NAME, "createBackup", |
| | | String.valueOf(configEntry), |
| | | String.valueOf(backupConfig)); |
| | | |
| | | |
| | | // Get the properties to use for the backup. We don't care whether or not |
| | |
| | | } |
| | | catch (Exception e) |
| | | { |
| | | assert debugException(CLASS_NAME, "createBackup", e); |
| | | if (debugEnabled()) |
| | | { |
| | | debugCought(DebugLogLevel.ERROR, e); |
| | | } |
| | | |
| | | int msgID = MSGID_CONFIG_BACKUP_CANNOT_GET_MAC; |
| | | String message = getMessage(msgID, macAlgorithm, |
| | |
| | | } |
| | | catch (Exception e) |
| | | { |
| | | assert debugException(CLASS_NAME, "createBackup", e); |
| | | if (debugEnabled()) |
| | | { |
| | | debugCought(DebugLogLevel.ERROR, e); |
| | | } |
| | | |
| | | int msgID = MSGID_CONFIG_BACKUP_CANNOT_GET_DIGEST; |
| | | String message = getMessage(msgID, digestAlgorithm, |
| | |
| | | } |
| | | catch (Exception e) |
| | | { |
| | | assert debugException(CLASS_NAME, "createBackup", e); |
| | | if (debugEnabled()) |
| | | { |
| | | debugCought(DebugLogLevel.ERROR, e); |
| | | } |
| | | |
| | | int msgID = MSGID_CONFIG_BACKUP_CANNOT_CREATE_ARCHIVE_FILE; |
| | | String message = getMessage(msgID, String.valueOf(filename), |
| | |
| | | } |
| | | catch (Exception e) |
| | | { |
| | | assert debugException(CLASS_NAME, "createBackup", e); |
| | | if (debugEnabled()) |
| | | { |
| | | debugCought(DebugLogLevel.ERROR, e); |
| | | } |
| | | |
| | | int msgID = MSGID_CONFIG_BACKUP_CANNOT_GET_CIPHER; |
| | | String message = getMessage(msgID, cipherAlgorithm, |
| | |
| | | } |
| | | catch (Exception e) |
| | | { |
| | | assert debugException(CLASS_NAME, "createBackup", e); |
| | | if (debugEnabled()) |
| | | { |
| | | debugCought(DebugLogLevel.ERROR, e); |
| | | } |
| | | |
| | | msgID = MSGID_CONFIG_BACKUP_CANNOT_DETERMINE_CONFIG_FILE_LOCATION; |
| | | message = getMessage(msgID, stackTraceToSingleLineString(e)); |
| | |
| | | } |
| | | catch (Exception e) |
| | | { |
| | | assert debugException(CLASS_NAME, "createBackup", e); |
| | | if (debugEnabled()) |
| | | { |
| | | debugCought(DebugLogLevel.ERROR, e); |
| | | } |
| | | |
| | | try |
| | | { |
| | |
| | | } |
| | | catch (Exception e) |
| | | { |
| | | assert debugException(CLASS_NAME, "createBackup", e); |
| | | if (debugEnabled()) |
| | | { |
| | | debugCought(DebugLogLevel.ERROR, e); |
| | | } |
| | | |
| | | try |
| | | { |
| | |
| | | } |
| | | catch (Exception e) |
| | | { |
| | | assert debugException(CLASS_NAME, "createBackup", e); |
| | | if (debugEnabled()) |
| | | { |
| | | debugCought(DebugLogLevel.ERROR, e); |
| | | } |
| | | |
| | | msgID = MSGID_CONFIG_BACKUP_CANNOT_CLOSE_ZIP_STREAM; |
| | | message = getMessage(msgID, filename, backupDirectory.getPath(), |
| | |
| | | } |
| | | catch (Exception e) |
| | | { |
| | | assert debugException(CLASS_NAME, "createBackup", e); |
| | | if (debugEnabled()) |
| | | { |
| | | debugCought(DebugLogLevel.ERROR, e); |
| | | } |
| | | |
| | | msgID = MSGID_CONFIG_BACKUP_CANNOT_UPDATE_BACKUP_DESCRIPTOR; |
| | | message = getMessage(msgID, backupDirectory.getDescriptorPath(), |
| | |
| | | String backupID) |
| | | throws DirectoryException |
| | | { |
| | | assert debugEnter(CLASS_NAME, "removeBackup", |
| | | String.valueOf(backupDirectory), |
| | | String.valueOf(backupID)); |
| | | |
| | | |
| | | // NYI |
| | |
| | | */ |
| | | public boolean supportsRestore() |
| | | { |
| | | assert debugEnter(CLASS_NAME, "supportsRestore"); |
| | | |
| | | |
| | | // We will provide a restore, but only for offline operations. |
| | |
| | | RestoreConfig restoreConfig) |
| | | throws DirectoryException |
| | | { |
| | | assert debugEnter(CLASS_NAME, "restoreBackup", String.valueOf(configEntry), |
| | | String.valueOf(restoreConfig)); |
| | | |
| | | |
| | | // First, make sure that the requested backup exists. |
| | |
| | | */ |
| | | public DN getComponentEntryDN() |
| | | { |
| | | assert debugEnter(CLASS_NAME, "getComponentEntryDN"); |
| | | |
| | | return configRootEntry.getDN(); |
| | | } |
| | |
| | | */ |
| | | public String getClassName() |
| | | { |
| | | assert debugEnter(CLASS_NAME, "getClassName"); |
| | | |
| | | return CLASS_NAME; |
| | | } |
| | |
| | | */ |
| | | public LinkedHashMap<String,String> getAlerts() |
| | | { |
| | | assert debugEnter(CLASS_NAME, "getAlerts"); |
| | | |
| | | LinkedHashMap<String,String> alerts = new LinkedHashMap<String,String>(); |
| | | |