Package org.opends.server.core
Class EntryCacheConfigManager
- java.lang.Object
-
- org.opends.server.core.EntryCacheConfigManager
-
- All Implemented Interfaces:
ConfigurationAddListener<EntryCacheCfg>
,ConfigurationChangeListener<EntryCacheCfg>
,ConfigurationDeleteListener<EntryCacheCfg>
public final class EntryCacheConfigManager extends Object implements ConfigurationChangeListener<EntryCacheCfg>, ConfigurationAddListener<EntryCacheCfg>, ConfigurationDeleteListener<EntryCacheCfg>
This class defines a utility that will be used to manage the configuration for the Directory Server entry cache. The default entry cache is always enabled.
-
-
Nested Class Summary
Nested Classes Modifier and Type Class Description static class
EntryCacheConfigManager.EntryCacheDispatcher
This class defines the entry cache dispatcher which acts as an arbiter for every entry cache implementation configured and installed within the Directory Server or acts an an empty cache if no implementation specific entry cache is configured.
-
Constructor Summary
Constructors Constructor Description EntryCacheConfigManager(ServerContext serverContext)
Creates a new instance of this entry cache config manager.
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description ConfigChangeResult
applyConfigurationAdd(EntryCacheCfg cfg)
Adds a new configuration to this add listener.ConfigChangeResult
applyConfigurationChange(EntryCacheCfg cfg)
Applies the configuration changes to this change listener.ConfigChangeResult
applyConfigurationDelete(EntryCacheCfg configuration)
Deletes an existing configuration from this delete listener.EntryCache<?>
getEntryCache()
Retrieves the entry cache dispatcher.void
initializeCacheConfigManager()
Initializes the configured entry cache managed by this entry cache config manager.void
initializeConfiguredEntryCaches()
Initializes the caches that are configured with the Directory Server.void
initializeGroupCache(GroupManager groupManager)
Initializes the group cache, which caches static groups.boolean
isConfigurationAddAcceptable(EntryCacheCfg configuration, List<LocalizableMessage> unacceptableReasons)
Indicates whether the proposed addition of a new configuration is acceptable to this add listener.boolean
isConfigurationChangeAcceptable(EntryCacheCfg configuration, List<LocalizableMessage> unacceptableReasons)
Indicates whether the proposed change to the configuration is acceptable to this change listener.boolean
isConfigurationDeleteAcceptable(EntryCacheCfg configuration, List<LocalizableMessage> unacceptableReasons)
Indicates whether the proposed deletion of an existing configuration is acceptable to this delete listener.
-
-
-
Constructor Detail
-
EntryCacheConfigManager
public EntryCacheConfigManager(ServerContext serverContext)
Creates a new instance of this entry cache config manager.- Parameters:
serverContext
- The server context.
-
-
Method Detail
-
initializeCacheConfigManager
public void initializeCacheConfigManager() throws InitializationException
Initializes the configured entry cache managed by this entry cache config manager.- Throws:
InitializationException
- If an error occurs during the initialization.
-
getEntryCache
public EntryCache<?> getEntryCache()
Retrieves the entry cache dispatcher.- Returns:
- The entry cache dispatcher.
-
initializeGroupCache
public void initializeGroupCache(GroupManager groupManager)
Initializes the group cache, which caches static groups.The group cache is always installed as the first cache and is not configurable.
This method should only be called at Directory Server startup.
- Parameters:
groupManager
- The group manager.
-
initializeConfiguredEntryCaches
public void initializeConfiguredEntryCaches() throws ConfigException
Initializes the caches that are configured with the Directory Server.This should only be called at Directory Server startup. If an error occurs, then a message will be logged for each entry cache that is failed to initialize.
- Throws:
ConfigException
- If a configuration problem causes the entry cache initialization process to fail.
-
isConfigurationChangeAcceptable
public boolean isConfigurationChangeAcceptable(EntryCacheCfg configuration, List<LocalizableMessage> unacceptableReasons)
Description copied from interface:ConfigurationChangeListener
Indicates whether the proposed change to the configuration is acceptable to this change listener.- Specified by:
isConfigurationChangeAcceptable
in interfaceConfigurationChangeListener<EntryCacheCfg>
- Parameters:
configuration
- The new configuration containing the changes.unacceptableReasons
- A list that can be used to hold messages about why the provided configuration is not acceptable.- Returns:
- Returns
true
if the proposed change is acceptable, orfalse
if it is not.
-
applyConfigurationChange
public ConfigChangeResult applyConfigurationChange(EntryCacheCfg cfg)
Description copied from interface:ConfigurationChangeListener
Applies the configuration changes to this change listener.- Specified by:
applyConfigurationChange
in interfaceConfigurationChangeListener<EntryCacheCfg>
- Parameters:
cfg
- The new configuration containing the changes.- Returns:
- Returns information about the result of changing the configuration.
-
isConfigurationAddAcceptable
public boolean isConfigurationAddAcceptable(EntryCacheCfg configuration, List<LocalizableMessage> unacceptableReasons)
Description copied from interface:ConfigurationAddListener
Indicates whether the proposed addition of a new configuration is acceptable to this add listener.- Specified by:
isConfigurationAddAcceptable
in interfaceConfigurationAddListener<EntryCacheCfg>
- Parameters:
configuration
- The configuration that will be added.unacceptableReasons
- A list that can be used to hold messages about why the provided configuration is not acceptable.- Returns:
- Returns
true
if the proposed addition is acceptable, orfalse
if it is not.
-
applyConfigurationAdd
public ConfigChangeResult applyConfigurationAdd(EntryCacheCfg cfg)
Description copied from interface:ConfigurationAddListener
Adds a new configuration to this add listener.- Specified by:
applyConfigurationAdd
in interfaceConfigurationAddListener<EntryCacheCfg>
- Parameters:
cfg
- The configuration that will be added.- Returns:
- Returns information about the result of adding the configuration.
-
isConfigurationDeleteAcceptable
public boolean isConfigurationDeleteAcceptable(EntryCacheCfg configuration, List<LocalizableMessage> unacceptableReasons)
Description copied from interface:ConfigurationDeleteListener
Indicates whether the proposed deletion of an existing configuration is acceptable to this delete listener.- Specified by:
isConfigurationDeleteAcceptable
in interfaceConfigurationDeleteListener<EntryCacheCfg>
- Parameters:
configuration
- The configuration that will be deleted.unacceptableReasons
- A list that can be used to hold messages about why the provided configuration is not acceptable.- Returns:
- Returns
true
if the proposed deletion is acceptable, orfalse
if it is not.
-
applyConfigurationDelete
public ConfigChangeResult applyConfigurationDelete(EntryCacheCfg configuration)
Description copied from interface:ConfigurationDeleteListener
Deletes an existing configuration from this delete listener.- Specified by:
applyConfigurationDelete
in interfaceConfigurationDeleteListener<EntryCacheCfg>
- Parameters:
configuration
- The existing configuration that will be deleted.- Returns:
- Returns information about the result of deleting the configuration.
-
-