| | |
| | | public void initializeBackend(ConfigEntry configEntry, DN[] baseDNs) |
| | | throws ConfigException, InitializationException |
| | | { |
| | | |
| | | |
| | | // Make sure that a configuration entry was provided. If not, then we will |
| | | // not be able to complete initialization. |
| | | if (configEntry == null) |
| | |
| | | */ |
| | | public void finalizeBackend() |
| | | { |
| | | |
| | | DirectoryServer.deregisterConfigurableComponent(this); |
| | | |
| | | try |
| | |
| | | */ |
| | | public DN[] getBaseDNs() |
| | | { |
| | | |
| | | return baseDNs; |
| | | } |
| | | |
| | |
| | | */ |
| | | public long getEntryCount() |
| | | { |
| | | |
| | | int numEntries = 1; |
| | | |
| | | AttributeType backupPathType = |
| | |
| | | */ |
| | | public boolean isLocal() |
| | | { |
| | | |
| | | // For the purposes of this method, this is a local backend. |
| | | return true; |
| | | } |
| | |
| | | public Entry getEntry(DN entryDN) |
| | | throws DirectoryException |
| | | { |
| | | |
| | | |
| | | // If the requested entry was null, then throw an exception. |
| | | if (entryDN == null) |
| | | { |
| | |
| | | private Entry getBackupDirectoryEntry(DN entryDN) |
| | | throws DirectoryException |
| | | { |
| | | |
| | | |
| | | // Make sure that the DN specifies a backup directory. |
| | | AttributeType t = |
| | | DirectoryServer.getAttributeType(ATTR_BACKUP_DIRECTORY_PATH, true); |
| | |
| | | private Entry getBackupEntry(DN entryDN) |
| | | throws DirectoryException |
| | | { |
| | | |
| | | |
| | | // First, get the backup ID from the entry DN. |
| | | AttributeType idType = DirectoryServer.getAttributeType(ATTR_BACKUP_ID, |
| | | true); |
| | |
| | | public void addEntry(Entry entry, AddOperation addOperation) |
| | | throws DirectoryException |
| | | { |
| | | |
| | | int msgID = MSGID_BACKUP_ADD_NOT_SUPPORTED; |
| | | String message = getMessage(msgID); |
| | | throw new DirectoryException(ResultCode.UNWILLING_TO_PERFORM, message, |
| | |
| | | public void deleteEntry(DN entryDN, DeleteOperation deleteOperation) |
| | | throws DirectoryException |
| | | { |
| | | |
| | | int msgID = MSGID_BACKUP_DELETE_NOT_SUPPORTED; |
| | | String message = getMessage(msgID); |
| | | throw new DirectoryException(ResultCode.UNWILLING_TO_PERFORM, message, |
| | |
| | | public void replaceEntry(Entry entry, ModifyOperation modifyOperation) |
| | | throws DirectoryException |
| | | { |
| | | |
| | | int msgID = MSGID_BACKUP_MODIFY_NOT_SUPPORTED; |
| | | String message = getMessage(msgID); |
| | | throw new DirectoryException(ResultCode.UNWILLING_TO_PERFORM, message, |
| | |
| | | ModifyDNOperation modifyDNOperation) |
| | | throws DirectoryException |
| | | { |
| | | |
| | | int msgID = MSGID_BACKUP_MODIFY_DN_NOT_SUPPORTED; |
| | | String message = getMessage(msgID); |
| | | throw new DirectoryException(ResultCode.UNWILLING_TO_PERFORM, message, |
| | |
| | | public void search(SearchOperation searchOperation) |
| | | throws DirectoryException |
| | | { |
| | | |
| | | |
| | | // Get the base entry for the search, if possible. If it doesn't exist, |
| | | // then this will throw an exception. |
| | | DN baseDN = searchOperation.getBaseDN(); |
| | |
| | | */ |
| | | public HashSet<String> getSupportedControls() |
| | | { |
| | | |
| | | return supportedControls; |
| | | } |
| | | |
| | |
| | | */ |
| | | public HashSet<String> getSupportedFeatures() |
| | | { |
| | | |
| | | return supportedFeatures; |
| | | } |
| | | |
| | |
| | | */ |
| | | public boolean supportsLDIFExport() |
| | | { |
| | | |
| | | // We do not support LDIF exports. |
| | | return false; |
| | | } |
| | |
| | | LDIFExportConfig exportConfig) |
| | | throws DirectoryException |
| | | { |
| | | |
| | | int msgID = MSGID_BACKUP_EXPORT_NOT_SUPPORTED; |
| | | String message = getMessage(msgID); |
| | | throw new DirectoryException(ResultCode.UNWILLING_TO_PERFORM, message, |
| | |
| | | */ |
| | | public boolean supportsLDIFImport() |
| | | { |
| | | |
| | | // This backend does not support LDIF imports. |
| | | return false; |
| | | } |
| | |
| | | LDIFImportConfig importConfig) |
| | | throws DirectoryException |
| | | { |
| | | |
| | | |
| | | // This backend does not support LDIF imports. |
| | | int msgID = MSGID_BACKUP_IMPORT_NOT_SUPPORTED; |
| | | String message = getMessage(msgID); |
| | |
| | | */ |
| | | public boolean supportsBackup() |
| | | { |
| | | |
| | | // This backend does not provide a backup/restore mechanism. |
| | | return false; |
| | | } |
| | |
| | | public boolean supportsBackup(BackupConfig backupConfig, |
| | | StringBuilder unsupportedReason) |
| | | { |
| | | |
| | | |
| | | // This backend does not provide a backup/restore mechanism. |
| | | return false; |
| | | } |
| | |
| | | public void createBackup(ConfigEntry configEntry, BackupConfig backupConfig) |
| | | throws DirectoryException |
| | | { |
| | | |
| | | |
| | | // This backend does not provide a backup/restore mechanism. |
| | | int msgID = MSGID_BACKUP_BACKUP_AND_RESTORE_NOT_SUPPORTED; |
| | | String message = getMessage(msgID); |
| | |
| | | String backupID) |
| | | throws DirectoryException |
| | | { |
| | | |
| | | |
| | | // This backend does not provide a backup/restore mechanism. |
| | | int msgID = MSGID_BACKUP_BACKUP_AND_RESTORE_NOT_SUPPORTED; |
| | | String message = getMessage(msgID); |
| | |
| | | */ |
| | | public boolean supportsRestore() |
| | | { |
| | | |
| | | |
| | | // This backend does not provide a backup/restore mechanism. |
| | | return false; |
| | | } |
| | |
| | | RestoreConfig restoreConfig) |
| | | throws DirectoryException |
| | | { |
| | | |
| | | |
| | | // This backend does not provide a backup/restore mechanism. |
| | | int msgID = MSGID_BACKUP_BACKUP_AND_RESTORE_NOT_SUPPORTED; |
| | | String message = getMessage(msgID); |
| | |
| | | */ |
| | | public DN getConfigurableComponentEntryDN() |
| | | { |
| | | |
| | | return configEntryDN; |
| | | } |
| | | |
| | |
| | | */ |
| | | public List<ConfigAttribute> getConfigurationAttributes() |
| | | { |
| | | |
| | | |
| | | LinkedList<ConfigAttribute> attrs = new LinkedList<ConfigAttribute>(); |
| | | |
| | | |
| | |
| | | public boolean hasAcceptableConfiguration(ConfigEntry configEntry, |
| | | List<String> unacceptableReasons) |
| | | { |
| | | |
| | | |
| | | // We'll accept anything here. The only configurable attribute is the |
| | | // default set of backup directories, but that doesn't require any |
| | | // validation at this point. |
| | |
| | | public ConfigChangeResult applyNewConfiguration(ConfigEntry configEntry, |
| | | boolean detailedResults) |
| | | { |
| | | |
| | | |
| | | ResultCode resultCode = ResultCode.SUCCESS; |
| | | boolean adminActionRequired = false; |
| | | ArrayList<String> messages = new ArrayList<String>(); |