| | |
| | | * |
| | | * |
| | | * Copyright 2007-2010 Sun Microsystems, Inc. |
| | | * Portions Copyright 2013 ForgeRock AS |
| | | * Portions Copyright 2013-2014 ForgeRock AS |
| | | */ |
| | | package org.opends.server.backends.jeb; |
| | | |
| | |
| | | import java.util.zip.Adler32; |
| | | import java.util.zip.CheckedInputStream; |
| | | |
| | | import com.sleepycat.je.DatabaseException; |
| | | import com.sleepycat.je.Durability; |
| | | import com.sleepycat.je.EnvironmentConfig; |
| | | import com.sleepycat.je.EnvironmentFailureException; |
| | | |
| | | import org.opends.messages.Message; |
| | | import org.opends.server.admin.Configuration; |
| | | import org.opends.server.admin.server.ConfigurationChangeListener; |
| | |
| | | import org.opends.server.api.MonitorProvider; |
| | | import org.opends.server.backends.jeb.importLDIF.Importer; |
| | | import org.opends.server.config.ConfigException; |
| | | import org.opends.server.core.AddOperation; |
| | | import org.opends.server.core.DeleteOperation; |
| | | import org.opends.server.core.DirectoryServer; |
| | | import org.opends.server.core.ModifyOperation; |
| | | import org.opends.server.core.ModifyDNOperation; |
| | | import org.opends.server.core.SearchOperation; |
| | | import org.opends.server.core.*; |
| | | import org.opends.server.extensions.DiskSpaceMonitor; |
| | | import org.opends.server.loggers.debug.DebugTracer; |
| | | import org.opends.server.types.*; |
| | | import org.opends.server.util.LDIFException; |
| | | import org.opends.server.util.RuntimeInformation; |
| | | import org.opends.server.util.Validator; |
| | | |
| | | import com.sleepycat.je.DatabaseException; |
| | | import com.sleepycat.je.Durability; |
| | | import com.sleepycat.je.EnvironmentConfig; |
| | | import com.sleepycat.je.EnvironmentFailureException; |
| | | |
| | | import static com.sleepycat.je.EnvironmentConfig.*; |
| | | |
| | | import static org.opends.messages.BackendMessages.*; |
| | | import static org.opends.messages.JebMessages.*; |
| | | import static org.opends.server.loggers.ErrorLogger.*; |
| | |
| | | /** |
| | | * The features supported by this backend. |
| | | */ |
| | | private static HashSet<String> supportedFeatures; |
| | | |
| | | static { |
| | | // Set our supported features. |
| | | supportedFeatures = new HashSet<String>(); |
| | | |
| | | //NYI |
| | | } |
| | | |
| | | |
| | | private static HashSet<String> supportedFeatures = new HashSet<String>(); |
| | | |
| | | /** |
| | | * Begin a Backend API method that reads the database. |
| | |
| | | return 0; |
| | | } |
| | | |
| | | |
| | | |
| | | /** |
| | | * {@inheritDoc} |
| | | */ |
| | | /** {@inheritDoc} */ |
| | | @Override |
| | | public void configureBackend(Configuration cfg) |
| | | throws ConfigException |
| | |
| | | dnSet.toArray(baseDNs); |
| | | } |
| | | |
| | | |
| | | |
| | | /** |
| | | * {@inheritDoc} |
| | | */ |
| | | /** {@inheritDoc} */ |
| | | @Override() |
| | | public void initializeBackend() |
| | | throws ConfigException, InitializationException |
| | |
| | | cfg.addLocalDBChangeListener(this); |
| | | } |
| | | |
| | | |
| | | |
| | | /** |
| | | * {@inheritDoc} |
| | | */ |
| | | /** {@inheritDoc} */ |
| | | @Override() |
| | | public void finalizeBackend() |
| | | { |
| | |
| | | logError(message); |
| | | } |
| | | |
| | | |
| | | |
| | | /** |
| | | * {@inheritDoc} |
| | | */ |
| | | /** {@inheritDoc} */ |
| | | @Override() |
| | | public boolean isLocal() |
| | | { |
| | |
| | | |
| | | |
| | | |
| | | /** |
| | | * {@inheritDoc} |
| | | */ |
| | | /** {@inheritDoc} */ |
| | | @Override() |
| | | public boolean isIndexed(AttributeType attributeType, IndexType indexType) |
| | | { |
| | |
| | | } |
| | | } |
| | | |
| | | |
| | | |
| | | /** |
| | | * {@inheritDoc} |
| | | */ |
| | | /** {@inheritDoc} */ |
| | | @Override() |
| | | public boolean supportsLDIFExport() |
| | | { |
| | | return true; |
| | | } |
| | | |
| | | |
| | | |
| | | /** |
| | | * {@inheritDoc} |
| | | */ |
| | | /** {@inheritDoc} */ |
| | | @Override() |
| | | public boolean supportsLDIFImport() |
| | | { |
| | | return true; |
| | | } |
| | | |
| | | |
| | | |
| | | /** |
| | | * {@inheritDoc} |
| | | */ |
| | | /** {@inheritDoc} */ |
| | | @Override() |
| | | public boolean supportsBackup() |
| | | { |
| | | return true; |
| | | } |
| | | |
| | | |
| | | |
| | | /** |
| | | * {@inheritDoc} |
| | | */ |
| | | /** {@inheritDoc} */ |
| | | @Override() |
| | | public boolean supportsBackup(BackupConfig backupConfig, |
| | | StringBuilder unsupportedReason) |
| | |
| | | return true; |
| | | } |
| | | |
| | | |
| | | |
| | | /** |
| | | * {@inheritDoc} |
| | | */ |
| | | /** {@inheritDoc} */ |
| | | @Override() |
| | | public boolean supportsRestore() |
| | | { |
| | | return true; |
| | | } |
| | | |
| | | |
| | | |
| | | /** |
| | | * {@inheritDoc} |
| | | */ |
| | | /** {@inheritDoc} */ |
| | | @Override() |
| | | public HashSet<String> getSupportedFeatures() |
| | | { |
| | | return supportedFeatures; |
| | | } |
| | | |
| | | |
| | | |
| | | /** |
| | | * {@inheritDoc} |
| | | */ |
| | | /** {@inheritDoc} */ |
| | | @Override() |
| | | public HashSet<String> getSupportedControls() |
| | | { |
| | | return supportedControls; |
| | | } |
| | | |
| | | |
| | | |
| | | /** |
| | | * {@inheritDoc} |
| | | */ |
| | | /** {@inheritDoc} */ |
| | | @Override() |
| | | public DN[] getBaseDNs() |
| | | { |
| | | return baseDNs; |
| | | } |
| | | |
| | | |
| | | |
| | | /** |
| | | * {@inheritDoc} |
| | | */ |
| | | /** {@inheritDoc} */ |
| | | @Override() |
| | | public long getEntryCount() |
| | | { |
| | |
| | | |
| | | |
| | | |
| | | /** |
| | | * {@inheritDoc} |
| | | */ |
| | | /** {@inheritDoc} */ |
| | | @Override() |
| | | public ConditionResult hasSubordinates(DN entryDN) |
| | | throws DirectoryException |
| | |
| | | |
| | | |
| | | |
| | | /** |
| | | * {@inheritDoc} |
| | | */ |
| | | /** {@inheritDoc} */ |
| | | @Override() |
| | | public long numSubordinates(DN entryDN, boolean subtree) |
| | | throws DirectoryException |
| | |
| | | |
| | | |
| | | |
| | | /** |
| | | * {@inheritDoc} |
| | | */ |
| | | /** {@inheritDoc} */ |
| | | @Override() |
| | | public Entry getEntry(DN entryDN) throws DirectoryException |
| | | { |
| | |
| | | |
| | | |
| | | |
| | | /** |
| | | * {@inheritDoc} |
| | | */ |
| | | /** {@inheritDoc} */ |
| | | @Override() |
| | | public void addEntry(Entry entry, AddOperation addOperation) |
| | | throws DirectoryException, CanceledOperationException |
| | |
| | | |
| | | |
| | | |
| | | /** |
| | | * {@inheritDoc} |
| | | */ |
| | | /** {@inheritDoc} */ |
| | | @Override() |
| | | public void deleteEntry(DN entryDN, DeleteOperation deleteOperation) |
| | | throws DirectoryException, CanceledOperationException |
| | |
| | | |
| | | |
| | | |
| | | /** |
| | | * {@inheritDoc} |
| | | */ |
| | | /** {@inheritDoc} */ |
| | | @Override() |
| | | public void replaceEntry(Entry oldEntry, Entry newEntry, |
| | | ModifyOperation modifyOperation) throws DirectoryException, |
| | |
| | | |
| | | |
| | | |
| | | /** |
| | | * {@inheritDoc} |
| | | */ |
| | | /** {@inheritDoc} */ |
| | | @Override() |
| | | public void renameEntry(DN currentDN, Entry entry, |
| | | ModifyDNOperation modifyDNOperation) |
| | |
| | | |
| | | |
| | | |
| | | /** |
| | | * {@inheritDoc} |
| | | */ |
| | | /** {@inheritDoc} */ |
| | | @Override() |
| | | public void search(SearchOperation searchOperation) |
| | | throws DirectoryException, CanceledOperationException |
| | |
| | | |
| | | |
| | | |
| | | /** |
| | | * {@inheritDoc} |
| | | */ |
| | | /** {@inheritDoc} */ |
| | | @Override() |
| | | public void exportLDIF(LDIFExportConfig exportConfig) |
| | | throws DirectoryException |
| | |
| | | // If the backend already has the root container open, we must use the same |
| | | // underlying root container |
| | | boolean openRootContainer = rootContainer == null; |
| | | |
| | | try |
| | | { |
| | | if(openRootContainer) |
| | | if (openRootContainer) |
| | | { |
| | | EnvironmentConfig envConfig = |
| | | ConfigurableEnvironment.parseConfigEntry(cfg); |
| | | |
| | | envConfig.setReadOnly(true); |
| | | envConfig.setAllowCreate(false); |
| | | envConfig.setTransactional(false); |
| | | envConfig.setConfigParam("je.env.isLocking", "true"); |
| | | envConfig.setConfigParam("je.env.runCheckpointer", "true"); |
| | | |
| | | rootContainer = initializeRootContainer(envConfig); |
| | | rootContainer = getReadOnlyRootContainer(); |
| | | } |
| | | |
| | | |
| | | ExportJob exportJob = new ExportJob(exportConfig); |
| | | exportJob.exportLDIF(rootContainer); |
| | | } |
| | |
| | | throw new DirectoryException(DirectoryServer.getServerErrorResultCode(), |
| | | message); |
| | | } |
| | | catch (JebException je) |
| | | { |
| | | if (debugEnabled()) |
| | | { |
| | | TRACER.debugCaught(DebugLogLevel.ERROR, je); |
| | | } |
| | | throw new DirectoryException(DirectoryServer.getServerErrorResultCode(), |
| | | je.getMessageObject()); |
| | | } |
| | | catch (DatabaseException de) |
| | | { |
| | | if (debugEnabled()) |
| | |
| | | } |
| | | throw createDirectoryException(de); |
| | | } |
| | | catch (LDIFException e) |
| | | catch (IdentifiedException e) |
| | | { |
| | | if (e instanceof DirectoryException) |
| | | { |
| | | throw (DirectoryException) e; |
| | | } |
| | | if (debugEnabled()) |
| | | { |
| | | TRACER.debugCaught(DebugLogLevel.ERROR, e); |
| | |
| | | throw new DirectoryException(DirectoryServer.getServerErrorResultCode(), |
| | | e.getMessageObject()); |
| | | } |
| | | catch (InitializationException ie) |
| | | { |
| | | if (debugEnabled()) |
| | | { |
| | | TRACER.debugCaught(DebugLogLevel.ERROR, ie); |
| | | } |
| | | throw new DirectoryException(DirectoryServer.getServerErrorResultCode(), |
| | | ie.getMessageObject()); |
| | | } |
| | | catch (ConfigException ce) |
| | | { |
| | | if (debugEnabled()) |
| | | { |
| | | TRACER.debugCaught(DebugLogLevel.ERROR, ce); |
| | | } |
| | | throw new DirectoryException(DirectoryServer.getServerErrorResultCode(), |
| | | ce.getMessageObject()); |
| | | } |
| | | finally |
| | | { |
| | | //If a root container was opened in this method as read only, close it |
| | | //to leave the backend in the same state. |
| | | if (openRootContainer && rootContainer != null) |
| | | { |
| | | try |
| | | { |
| | | rootContainer.close(); |
| | | rootContainer = null; |
| | | } |
| | | catch (DatabaseException e) |
| | | { |
| | | if (debugEnabled()) |
| | | { |
| | | TRACER.debugCaught(DebugLogLevel.ERROR, e); |
| | | } |
| | | } |
| | | } |
| | | closeTemporaryRootContainer(openRootContainer); |
| | | } |
| | | } |
| | | |
| | | |
| | | |
| | | /** |
| | | * {@inheritDoc} |
| | | */ |
| | | /** {@inheritDoc} */ |
| | | @Override() |
| | | public LDIFImportResult importLDIF(LDIFImportConfig importConfig) |
| | | throws DirectoryException |
| | |
| | | |
| | | try |
| | | { |
| | | EnvironmentConfig envConfig = new EnvironmentConfig(); |
| | | final EnvironmentConfig envConfig = getEnvConfigForImport(); |
| | | |
| | | envConfig.setAllowCreate(true); |
| | | envConfig.setTransactional(false); |
| | | envConfig.setDurability(Durability.COMMIT_NO_SYNC); |
| | | envConfig.setLockTimeout(0, TimeUnit.SECONDS); |
| | | envConfig.setTxnTimeout(0, TimeUnit.SECONDS); |
| | | envConfig.setConfigParam(EnvironmentConfig.CLEANER_MIN_FILE_UTILIZATION, |
| | | String.valueOf(cfg.getDBCleanerMinUtilization())); |
| | | envConfig.setConfigParam(EnvironmentConfig.LOG_FILE_MAX, String |
| | | .valueOf(cfg.getDBLogFileMax())); |
| | | |
| | | if(!importConfig.appendToExistingData()) { |
| | | if(importConfig.clearBackend() || cfg.getBaseDN().size() <= 1) { |
| | | // We have the writer lock on the environment, now delete the |
| | | // environment and re-open it. Only do this when we are |
| | | // importing to all the base DNs in the backend or if the backend only |
| | | // have one base DN. |
| | | File parentDirectory = getFileForPath(cfg.getDBDirectory()); |
| | | File backendDirectory = new File(parentDirectory, cfg.getBackendId()); |
| | | // If the backend does not exist the import will create it. |
| | | if (backendDirectory.exists()) { |
| | | EnvManager.removeFiles(backendDirectory.getPath()); |
| | | } |
| | | if (!importConfig.appendToExistingData() |
| | | && (importConfig.clearBackend() || cfg.getBaseDN().size() <= 1)) |
| | | { |
| | | // We have the writer lock on the environment, now delete the |
| | | // environment and re-open it. Only do this when we are |
| | | // importing to all the base DNs in the backend or if the backend only |
| | | // have one base DN. |
| | | File parentDirectory = getFileForPath(cfg.getDBDirectory()); |
| | | File backendDirectory = new File(parentDirectory, cfg.getBackendId()); |
| | | // If the backend does not exist the import will create it. |
| | | if (backendDirectory.exists()) |
| | | { |
| | | EnvManager.removeFiles(backendDirectory.getPath()); |
| | | } |
| | | } |
| | | |
| | |
| | | } |
| | | } |
| | | |
| | | |
| | | private EnvironmentConfig getEnvConfigForImport() |
| | | { |
| | | final EnvironmentConfig envConfig = new EnvironmentConfig(); |
| | | envConfig.setAllowCreate(true); |
| | | envConfig.setTransactional(false); |
| | | envConfig.setDurability(Durability.COMMIT_NO_SYNC); |
| | | envConfig.setLockTimeout(0, TimeUnit.SECONDS); |
| | | envConfig.setTxnTimeout(0, TimeUnit.SECONDS); |
| | | envConfig.setConfigParam(CLEANER_MIN_FILE_UTILIZATION, |
| | | String.valueOf(cfg.getDBCleanerMinUtilization())); |
| | | envConfig.setConfigParam(LOG_FILE_MAX, |
| | | String.valueOf(cfg.getDBLogFileMax())); |
| | | return envConfig; |
| | | } |
| | | |
| | | /** |
| | | * Verify the integrity of the backend instance. |
| | |
| | | |
| | | try |
| | | { |
| | | if(openRootContainer) |
| | | if (openRootContainer) |
| | | { |
| | | EnvironmentConfig envConfig = |
| | | ConfigurableEnvironment.parseConfigEntry(cfg); |
| | | |
| | | envConfig.setReadOnly(true); |
| | | envConfig.setAllowCreate(false); |
| | | envConfig.setTransactional(false); |
| | | envConfig.setConfigParam("je.env.isLocking", "true"); |
| | | envConfig.setConfigParam("je.env.runCheckpointer", "true"); |
| | | |
| | | rootContainer = initializeRootContainer(envConfig); |
| | | rootContainer = getReadOnlyRootContainer(); |
| | | } |
| | | |
| | | VerifyJob verifyJob = new VerifyJob(verifyConfig); |
| | |
| | | } |
| | | finally |
| | | { |
| | | //If a root container was opened in this method as read only, close it |
| | | //to leave the backend in the same state. |
| | | if (openRootContainer && rootContainer != null) |
| | | { |
| | | try |
| | | { |
| | | rootContainer.close(); |
| | | rootContainer = null; |
| | | } |
| | | catch (DatabaseException e) |
| | | { |
| | | if (debugEnabled()) |
| | | { |
| | | TRACER.debugCaught(DebugLogLevel.ERROR, e); |
| | | } |
| | | } |
| | | } |
| | | closeTemporaryRootContainer(openRootContainer); |
| | | } |
| | | return errorCount; |
| | | } |
| | |
| | | |
| | | try |
| | | { |
| | | EnvironmentConfig envConfig; |
| | | final EnvironmentConfig envConfig; |
| | | if (openRootContainer) |
| | | { |
| | | envConfig = new EnvironmentConfig(); |
| | | envConfig.setAllowCreate(true); |
| | | envConfig.setTransactional(false); |
| | | envConfig.setDurability(Durability.COMMIT_NO_SYNC); |
| | | envConfig.setLockTimeout(0, TimeUnit.SECONDS); |
| | | envConfig.setTxnTimeout(0, TimeUnit.SECONDS); |
| | | envConfig.setConfigParam( |
| | | EnvironmentConfig.CLEANER_MIN_FILE_UTILIZATION, String.valueOf(cfg |
| | | .getDBCleanerMinUtilization())); |
| | | envConfig.setConfigParam(EnvironmentConfig.LOG_FILE_MAX, String |
| | | .valueOf(cfg.getDBLogFileMax())); |
| | | envConfig = getEnvConfigForImport(); |
| | | |
| | | Importer importer = new Importer(rebuildConfig, cfg, envConfig); |
| | | rootContainer = initializeRootContainer(envConfig); |
| | |
| | | } |
| | | finally |
| | | { |
| | | //If a root container was opened in this method as read only, close it |
| | | //to leave the backend in the same state. |
| | | if (openRootContainer && rootContainer != null) |
| | | closeTemporaryRootContainer(openRootContainer); |
| | | } |
| | | } |
| | | |
| | | /** |
| | | * If a root container was opened in the calling method method as read only, |
| | | * close it to leave the backend in the same state. |
| | | */ |
| | | private void closeTemporaryRootContainer(boolean openRootContainer) |
| | | { |
| | | if (openRootContainer && rootContainer != null) |
| | | { |
| | | try |
| | | { |
| | | try |
| | | rootContainer.close(); |
| | | rootContainer = null; |
| | | } |
| | | catch (DatabaseException e) |
| | | { |
| | | if (debugEnabled()) |
| | | { |
| | | rootContainer.close(); |
| | | rootContainer = null; |
| | | } |
| | | catch (DatabaseException e) |
| | | { |
| | | if (debugEnabled()) |
| | | { |
| | | TRACER.debugCaught(DebugLogLevel.ERROR, e); |
| | | } |
| | | TRACER.debugCaught(DebugLogLevel.ERROR, e); |
| | | } |
| | | } |
| | | } |
| | | } |
| | | |
| | | |
| | | /** |
| | | * {@inheritDoc} |
| | | */ |
| | | /** {@inheritDoc} */ |
| | | @Override() |
| | | public void createBackup(BackupConfig backupConfig) |
| | | throws DirectoryException |
| | |
| | | |
| | | |
| | | |
| | | /** |
| | | * {@inheritDoc} |
| | | */ |
| | | /** {@inheritDoc} */ |
| | | @Override() |
| | | public void removeBackup(BackupDirectory backupDirectory, String backupID) |
| | | throws DirectoryException |
| | |
| | | |
| | | |
| | | |
| | | /** |
| | | * {@inheritDoc} |
| | | */ |
| | | /** {@inheritDoc} */ |
| | | @Override() |
| | | public void restoreBackup(RestoreConfig restoreConfig) |
| | | throws DirectoryException |
| | |
| | | |
| | | |
| | | |
| | | /** |
| | | * {@inheritDoc} |
| | | */ |
| | | /** {@inheritDoc} */ |
| | | @Override() |
| | | public boolean isConfigurationAcceptable(Configuration configuration, |
| | | List<Message> unacceptableReasons) |
| | |
| | | |
| | | |
| | | |
| | | /** |
| | | * {@inheritDoc} |
| | | */ |
| | | /** {@inheritDoc} */ |
| | | @Override |
| | | public boolean isConfigurationChangeAcceptable( |
| | | LocalDBBackendCfg cfg, |
| | |
| | | |
| | | |
| | | |
| | | /** |
| | | * {@inheritDoc} |
| | | */ |
| | | /** {@inheritDoc} */ |
| | | @Override |
| | | public ConfigChangeResult applyConfigurationChange(LocalDBBackendCfg newCfg) |
| | | { |
| | | ConfigChangeResult ccr; |
| | | ResultCode resultCode = ResultCode.SUCCESS; |
| | | ArrayList<Message> messages = new ArrayList<Message>(); |
| | | |
| | |
| | | messages.add(ERR_BACKEND_CANNOT_REGISTER_BASEDN.get( |
| | | String.valueOf(baseDN), |
| | | String.valueOf(e))); |
| | | ccr = new ConfigChangeResult(resultCode, false, messages); |
| | | return ccr; |
| | | return new ConfigChangeResult(resultCode, false, messages); |
| | | } |
| | | } |
| | | } |
| | |
| | | catch (Exception e) |
| | | { |
| | | messages.add(Message.raw(stackTraceToSingleLineString(e))); |
| | | ccr = new ConfigChangeResult(DirectoryServer.getServerErrorResultCode(), |
| | | false, messages); |
| | | return ccr; |
| | | return new ConfigChangeResult( |
| | | DirectoryServer.getServerErrorResultCode(), false, messages); |
| | | } |
| | | |
| | | ccr = new ConfigChangeResult(resultCode, false, messages); |
| | | return ccr; |
| | | return new ConfigChangeResult(resultCode, false, messages); |
| | | } |
| | | |
| | | /** |
| | |
| | | envConfig.setReadOnly(true); |
| | | envConfig.setAllowCreate(false); |
| | | envConfig.setTransactional(false); |
| | | envConfig.setConfigParam("je.env.isLocking", "true"); |
| | | envConfig.setConfigParam("je.env.runCheckpointer", "true"); |
| | | envConfig.setConfigParam(ENV_IS_LOCKING, "true"); |
| | | envConfig.setConfigParam(ENV_RUN_CHECKPOINTER, "true"); |
| | | |
| | | return initializeRootContainer(envConfig); |
| | | } |
| | |
| | | * @return DirectoryException created from exception. |
| | | */ |
| | | DirectoryException createDirectoryException(DatabaseException e) { |
| | | ResultCode resultCode = DirectoryServer.getServerErrorResultCode(); |
| | | Message message; |
| | | if ((e instanceof EnvironmentFailureException) && |
| | | !rootContainer.isValid()) { |
| | | message = NOTE_BACKEND_ENVIRONMENT_UNUSABLE.get(getBackendID()); |
| | | if (e instanceof EnvironmentFailureException && !rootContainer.isValid()) { |
| | | Message message = NOTE_BACKEND_ENVIRONMENT_UNUSABLE.get(getBackendID()); |
| | | logError(message); |
| | | DirectoryServer.sendAlertNotification(DirectoryServer.getInstance(), |
| | | ALERT_TYPE_BACKEND_ENVIRONMENT_UNUSABLE, message); |
| | |
| | | if (jeMessage == null) { |
| | | jeMessage = stackTraceToSingleLineString(e); |
| | | } |
| | | message = ERR_JEB_DATABASE_EXCEPTION.get(jeMessage); |
| | | return new DirectoryException(resultCode, message, e); |
| | | Message message = ERR_JEB_DATABASE_EXCEPTION.get(jeMessage); |
| | | return new DirectoryException( |
| | | DirectoryServer.getServerErrorResultCode(), message, e); |
| | | } |
| | | |
| | | /** |
| | | * {@inheritDoc} |
| | | */ |
| | | /** {@inheritDoc} */ |
| | | @Override |
| | | public String getClassName() { |
| | | return CLASS_NAME; |
| | | } |
| | | |
| | | /** |
| | | * {@inheritDoc} |
| | | */ |
| | | /** {@inheritDoc} */ |
| | | @Override |
| | | public Map<String, String> getAlerts() |
| | | { |
| | |
| | | return alerts; |
| | | } |
| | | |
| | | /** |
| | | * {@inheritDoc} |
| | | */ |
| | | /** {@inheritDoc} */ |
| | | @Override |
| | | public DN getComponentEntryDN() { |
| | | return cfg.dn(); |
| | |
| | | } |
| | | } |
| | | |
| | | /** |
| | | * {@inheritDoc} |
| | | */ |
| | | /** {@inheritDoc} */ |
| | | @Override |
| | | public void preloadEntryCache() throws |
| | | UnsupportedOperationException { |
| | |
| | | preloader.preload(); |
| | | } |
| | | |
| | | /** |
| | | * {@inheritDoc} |
| | | */ |
| | | /** {@inheritDoc} */ |
| | | @Override |
| | | public void diskLowThresholdReached(DiskSpaceMonitor monitor) { |
| | | Message msg = ERR_JEB_DISK_LOW_THRESHOLD_REACHED.get( |
| | |
| | | ALERT_TYPE_DISK_SPACE_LOW, msg); |
| | | } |
| | | |
| | | /** |
| | | * {@inheritDoc} |
| | | */ |
| | | /** {@inheritDoc} */ |
| | | @Override |
| | | public void diskFullThresholdReached(DiskSpaceMonitor monitor) { |
| | | Message msg = ERR_JEB_DISK_FULL_THRESHOLD_REACHED.get( |
| | |
| | | ALERT_TYPE_DISK_FULL, msg); |
| | | } |
| | | |
| | | /** |
| | | * {@inheritDoc} |
| | | */ |
| | | /** {@inheritDoc} */ |
| | | @Override |
| | | public void diskSpaceRestored(DiskSpaceMonitor monitor) { |
| | | Message msg = NOTE_JEB_DISK_SPACE_RESTORED.get(monitor.getFreeSpace(), |