| | |
| | | DN[] baseDNs) |
| | | throws ConfigException, InitializationException |
| | | { |
| | | |
| | | |
| | | // We won't support anything other than exactly one base DN in this |
| | | // implementation. If we were to add such support in the future, we would |
| | | // likely want to separate the data for each base DN into a separate entry |
| | |
| | | */ |
| | | public synchronized void finalizeBackend() |
| | | { |
| | | |
| | | clearMemoryBackend(); |
| | | |
| | | for (DN dn : baseDNs) |
| | |
| | | */ |
| | | public DN[] getBaseDNs() |
| | | { |
| | | |
| | | return baseDNs; |
| | | } |
| | | |
| | |
| | | */ |
| | | public synchronized long getEntryCount() |
| | | { |
| | | |
| | | if (entryMap != null) |
| | | { |
| | | return entryMap.size(); |
| | |
| | | */ |
| | | public boolean isLocal() |
| | | { |
| | | |
| | | // For the purposes of this method, this is a local backend. |
| | | return true; |
| | | } |
| | |
| | | */ |
| | | public synchronized Entry getEntry(DN entryDN) |
| | | { |
| | | |
| | | return entryMap.get(entryDN); |
| | | } |
| | | |
| | |
| | | */ |
| | | public synchronized boolean entryExists(DN entryDN) |
| | | { |
| | | |
| | | return entryMap.containsKey(entryDN); |
| | | } |
| | | |
| | |
| | | public synchronized void addEntry(Entry entry, AddOperation addOperation) |
| | | throws DirectoryException |
| | | { |
| | | |
| | | |
| | | // See if the target entry already exists. If so, then fail. |
| | | DN entryDN = entry.getDN(); |
| | | if (entryMap.containsKey(entryDN)) |
| | |
| | | DeleteOperation deleteOperation) |
| | | throws DirectoryException |
| | | { |
| | | |
| | | |
| | | // Make sure the entry exists. If not, then throw an exception. |
| | | if (! entryMap.containsKey(entryDN)) |
| | | { |
| | |
| | | ModifyOperation modifyOperation) |
| | | throws DirectoryException |
| | | { |
| | | |
| | | |
| | | // Make sure the entry exists. If not, then throw an exception. |
| | | DN entryDN = entry.getDN(); |
| | | if (! entryMap.containsKey(entryDN)) |
| | |
| | | ModifyDNOperation modifyDNOperation) |
| | | throws DirectoryException |
| | | { |
| | | |
| | | |
| | | // Make sure that the target entry exists. |
| | | if (! entryMap.containsKey(currentDN)) |
| | | { |
| | |
| | | public synchronized void search(SearchOperation searchOperation) |
| | | throws DirectoryException |
| | | { |
| | | |
| | | |
| | | // Get the base DN, scope, and filter for the search. |
| | | DN baseDN = searchOperation.getBaseDN(); |
| | | SearchScope scope = searchOperation.getScope(); |
| | |
| | | */ |
| | | public HashSet<String> getSupportedControls() |
| | | { |
| | | |
| | | return supportedControls; |
| | | } |
| | | |
| | |
| | | */ |
| | | public HashSet<String> getSupportedFeatures() |
| | | { |
| | | |
| | | return supportedFeatures; |
| | | } |
| | | |
| | |
| | | */ |
| | | public boolean supportsLDIFExport() |
| | | { |
| | | |
| | | return true; |
| | | } |
| | | |
| | |
| | | LDIFExportConfig exportConfig) |
| | | throws DirectoryException |
| | | { |
| | | |
| | | |
| | | // Create the LDIF writer. |
| | | LDIFWriter ldifWriter; |
| | | try |
| | |
| | | */ |
| | | public boolean supportsLDIFImport() |
| | | { |
| | | |
| | | return true; |
| | | } |
| | | |
| | |
| | | LDIFImportConfig importConfig) |
| | | throws DirectoryException |
| | | { |
| | | |
| | | |
| | | clearMemoryBackend(); |
| | | |
| | | LDIFReader reader; |
| | |
| | | */ |
| | | 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 |
| | | { |
| | | |
| | | |
| | | int msgID = MSGID_MEMORYBACKEND_BACKUP_RESTORE_NOT_SUPPORTED; |
| | | String message = getMessage(msgID); |
| | | throw new DirectoryException(ResultCode.UNWILLING_TO_PERFORM, message, |
| | |
| | | String backupID) |
| | | throws DirectoryException |
| | | { |
| | | |
| | | |
| | | int msgID = MSGID_MEMORYBACKEND_BACKUP_RESTORE_NOT_SUPPORTED; |
| | | String message = getMessage(msgID); |
| | | throw new DirectoryException(ResultCode.UNWILLING_TO_PERFORM, message, |
| | |
| | | */ |
| | | public boolean supportsRestore() |
| | | { |
| | | |
| | | |
| | | // This backend does not provide a backup/restore mechanism. |
| | | return false; |
| | | } |
| | |
| | | RestoreConfig restoreConfig) |
| | | throws DirectoryException |
| | | { |
| | | |
| | | |
| | | int msgID = MSGID_MEMORYBACKEND_BACKUP_RESTORE_NOT_SUPPORTED; |
| | | String message = getMessage(msgID); |
| | | throw new DirectoryException(ResultCode.UNWILLING_TO_PERFORM, message, |