| | |
| | | */ |
| | | private void readerBegin() |
| | | { |
| | | |
| | | threadTotalCount.getAndIncrement(); |
| | | } |
| | | |
| | |
| | | */ |
| | | private void readerEnd() |
| | | { |
| | | |
| | | threadTotalCount.getAndDecrement(); |
| | | } |
| | | |
| | |
| | | */ |
| | | private void writerBegin() |
| | | { |
| | | |
| | | threadTotalCount.getAndIncrement(); |
| | | threadWriteCount.getAndIncrement(); |
| | | } |
| | |
| | | */ |
| | | private void writerEnd() |
| | | { |
| | | |
| | | threadWriteCount.getAndDecrement(); |
| | | threadTotalCount.getAndDecrement(); |
| | | } |
| | |
| | | */ |
| | | private void waitUntilQuiescent() |
| | | { |
| | | |
| | | while (threadTotalCount.get() > 0) |
| | | { |
| | | // Still have threads in the database so sleep a little |
| | |
| | | */ |
| | | public static String getContainerName(DN dn) |
| | | { |
| | | |
| | | String normStr = dn.toNormalizedString(); |
| | | StringBuilder builder = new StringBuilder(normStr.length()); |
| | | for (int i = 0; i < normStr.length(); i++) |
| | |
| | | public void initializeBackend(ConfigEntry configEntry, DN[] baseDNs) |
| | | throws ConfigException, InitializationException |
| | | { |
| | | |
| | | configDN = configEntry.getDN(); |
| | | |
| | | // Initialize a config object |
| | |
| | | */ |
| | | public void finalizeBackend() |
| | | { |
| | | |
| | | // Deregister our configurable components. |
| | | // TODO: configurableEnv is always null and will not be deregistered. |
| | | if (configurableEnv != null) |
| | |
| | | */ |
| | | public boolean isLocal() |
| | | { |
| | | |
| | | return true; |
| | | } |
| | | |
| | |
| | | */ |
| | | public boolean supportsLDIFExport() |
| | | { |
| | | |
| | | return true; |
| | | } |
| | | |
| | |
| | | */ |
| | | public boolean supportsLDIFImport() |
| | | { |
| | | |
| | | return true; |
| | | } |
| | | |
| | |
| | | */ |
| | | public boolean supportsBackup() |
| | | { |
| | | |
| | | return true; |
| | | } |
| | | |
| | |
| | | public boolean supportsBackup(BackupConfig backupConfig, |
| | | StringBuilder unsupportedReason) |
| | | { |
| | | |
| | | return true; |
| | | } |
| | | |
| | |
| | | */ |
| | | public boolean supportsRestore() |
| | | { |
| | | |
| | | return true; |
| | | } |
| | | |
| | |
| | | */ |
| | | public HashSet<String> getSupportedFeatures() |
| | | { |
| | | |
| | | return new HashSet<String>(); //NYI |
| | | } |
| | | |
| | |
| | | */ |
| | | public HashSet<String> getSupportedControls() |
| | | { |
| | | |
| | | return supportedControls; |
| | | } |
| | | |
| | |
| | | */ |
| | | public DN[] getBaseDNs() |
| | | { |
| | | |
| | | return config.getBaseDNs(); |
| | | } |
| | | |
| | |
| | | */ |
| | | public long getEntryCount() |
| | | { |
| | | |
| | | if (rootContainer != null) |
| | | { |
| | | try |
| | |
| | | */ |
| | | public Entry getEntry(DN entryDN) throws DirectoryException |
| | | { |
| | | |
| | | readerBegin(); |
| | | try |
| | | { |
| | |
| | | public void addEntry(Entry entry, AddOperation addOperation) |
| | | throws DirectoryException |
| | | { |
| | | |
| | | writerBegin(); |
| | | try |
| | | { |
| | |
| | | public void deleteEntry(DN entryDN, DeleteOperation deleteOperation) |
| | | throws DirectoryException |
| | | { |
| | | |
| | | writerBegin(); |
| | | try |
| | | { |
| | |
| | | public void replaceEntry(Entry entry, ModifyOperation modifyOperation) |
| | | throws DirectoryException |
| | | { |
| | | |
| | | writerBegin(); |
| | | try |
| | | { |
| | |
| | | ModifyDNOperation modifyDNOperation) |
| | | throws DirectoryException, CancelledOperationException |
| | | { |
| | | |
| | | writerBegin(); |
| | | try |
| | | { |
| | |
| | | public void search(SearchOperation searchOperation) |
| | | throws DirectoryException |
| | | { |
| | | |
| | | readerBegin(); |
| | | try |
| | | { |
| | |
| | | LDIFExportConfig exportConfig) |
| | | throws DirectoryException |
| | | { |
| | | |
| | | // Initialize a config object. |
| | | config = new Config(); |
| | | |
| | |
| | | LDIFImportConfig importConfig) |
| | | throws DirectoryException |
| | | { |
| | | |
| | | // Initialize a config object. |
| | | config = new Config(); |
| | | |
| | |
| | | DN[] baseDNs, Entry statEntry) |
| | | throws InitializationException, ConfigException, DirectoryException |
| | | { |
| | | |
| | | // Initialize a config object. |
| | | config = new Config(); |
| | | config.initializeConfig(configEntry, baseDNs); |
| | |
| | | public void createBackup(ConfigEntry configEntry, BackupConfig backupConfig) |
| | | throws DirectoryException |
| | | { |
| | | |
| | | BackupManager backupManager = |
| | | new BackupManager(getBackendID()); |
| | | backupManager.createBackup(configEntry, backupConfig); |
| | |
| | | public void removeBackup(BackupDirectory backupDirectory, String backupID) |
| | | throws DirectoryException |
| | | { |
| | | |
| | | BackupManager backupManager = |
| | | new BackupManager(getBackendID()); |
| | | backupManager.removeBackup(backupDirectory, backupID); |
| | |
| | | RestoreConfig restoreConfig) |
| | | throws DirectoryException |
| | | { |
| | | |
| | | BackupManager backupManager = |
| | | new BackupManager(getBackendID()); |
| | | backupManager.restoreBackup(configEntry, restoreConfig); |
| | |
| | | */ |
| | | public DN getConfigurableComponentEntryDN() |
| | | { |
| | | |
| | | return configDN; |
| | | } |
| | | |
| | |
| | | */ |
| | | public List<ConfigAttribute> getConfigurationAttributes() |
| | | { |
| | | |
| | | return configAttrs; |
| | | } |
| | | |
| | |
| | | public boolean hasAcceptableConfiguration(ConfigEntry configEntry, |
| | | List<String> unacceptableReasons) |
| | | { |
| | | |
| | | DN[] baseDNs = null; |
| | | boolean acceptable = true; |
| | | |
| | |
| | | public ConfigChangeResult applyNewConfiguration(ConfigEntry configEntry, |
| | | boolean detailedResults) |
| | | { |
| | | |
| | | ConfigChangeResult ccr; |
| | | ResultCode resultCode = ResultCode.SUCCESS; |
| | | ArrayList<String> messages = new ArrayList<String>(); |