public class DefaultEntryCache extends EntryCache<org.forgerock.opendj.server.config.server.EntryCacheCfg> implements org.forgerock.opendj.config.server.ConfigurationChangeListener<org.forgerock.opendj.server.config.server.EntryCacheCfg>, LocalBackendInitializationListener
cacheHits, cacheMisses| Constructor and Description |
|---|
DefaultEntryCache()
Creates a new instance of this default entry cache.
|
| Modifier and Type | Method and Description |
|---|---|
org.forgerock.opendj.config.server.ConfigChangeResult |
applyConfigurationChange(org.forgerock.opendj.server.config.server.EntryCacheCfg configuration) |
void |
clear()
Removes all entries from the cache.
|
void |
clearBackend(String backendID)
Removes all entries from the cache that are associated with the
provided backend.
|
boolean |
containsEntry(org.forgerock.opendj.ldap.DN entryDN)
Indicates whether the entry cache currently contains the entry
with the specified DN.
|
void |
finalizeEntryCache()
Performs any necessary cleanup work (e.g., flushing all cached
entries and releasing any other held resources) that should be
performed when the server is to be shut down or the entry cache
destroyed or replaced.
|
Long |
getCacheCount()
Retrieves the current number of entries stored within the cache.
|
static EntryCache<? extends org.forgerock.opendj.server.config.server.EntryCacheCfg>[] |
getCacheOrder()
Retrieves the current cache order array.
|
Entry |
getEntry(org.forgerock.opendj.ldap.DN entryDN)
Retrieves the entry with the specified DN from the cache.
|
Entry |
getEntry(String backendID,
long entryID)
Retrieves the requested entry if it is present in the cache.
|
org.forgerock.opendj.ldap.DN |
getEntryDN(String backendID,
long entryID)
Retrieves the entry DN for the entry with the specified ID on
the specific backend from the cache.
|
long |
getEntryID(org.forgerock.opendj.ldap.DN entryDN)
Retrieves the entry ID for the entry with the specified DN from
the cache.
|
MonitorData |
getMonitorData()
Retrieves a set of attributes containing monitor data that should
be returned to the client if the corresponding monitor entry is
requested.
|
void |
handleLowMemory()
Attempts to react to a scenario in which it is determined that
the system is running low on available memory.
|
void |
initializeEntryCache(ServerContext serverContext,
org.forgerock.opendj.server.config.server.EntryCacheCfg configEntry)
Initializes this entry cache implementation so that it will be
available for storing and retrieving entries.
|
boolean |
isConfigurationChangeAcceptable(org.forgerock.opendj.server.config.server.EntryCacheCfg configuration,
List<org.forgerock.i18n.LocalizableMessage> unacceptableReasons) |
void |
performBackendPostFinalizationProcessing(LocalBackend<?> backend)
Performs any processing that may be required whenever a backend
is finalized.
|
void |
performBackendPostInitializationProcessing(LocalBackend<?> backend)
Performs any processing that may be required
after the Initialisation cycle has been completed, that is
all listeners have received the initialisation event, and the
backend has been put into service,.
|
void |
performBackendPreFinalizationProcessing(LocalBackend<?> backend)
Performs any processing that may be required before starting
the finalisation cycle, that is invoked before any listener receive
the Finalization event.
|
void |
performBackendPreInitializationProcessing(LocalBackend<?> backend)
Performs any processing that may be required whenever a backend
is initialized for use in the Directory Server.
|
void |
putEntry(Entry entry,
String backendID,
long entryID)
Stores the provided entry in the cache.
|
boolean |
putEntryIfAbsent(Entry entry,
String backendID,
long entryID)
Stores the provided entry in the cache only if it does not
conflict with an entry that already exists.
|
void |
removeEntry(org.forgerock.opendj.ldap.DN entryDN)
Removes the specified entry from the cache.
|
static void |
setCacheOrder(SortedMap<Integer,EntryCache<? extends org.forgerock.opendj.server.config.server.EntryCacheCfg>> cacheOrderMap)
Sets the current cache order array.
|
String |
toVerboseString()
Return a verbose string representation of the current cache maps.
|
filtersAllowCaching, getCacheHits, getCacheMisses, getEntryCacheMonitor, getExcludeFilters, getIncludeFilters, isConfigurationAcceptable, setEntryCacheMonitor, setExcludeFilters, setIncludeFilterspublic DefaultEntryCache()
public void initializeEntryCache(ServerContext serverContext, org.forgerock.opendj.server.config.server.EntryCacheCfg configEntry) throws org.forgerock.opendj.config.server.ConfigException, InitializationException
EntryCacheinitializeEntryCache in class EntryCache<org.forgerock.opendj.server.config.server.EntryCacheCfg>serverContext - The server context.configEntry - The configuration to use to initialize
the entry cache.org.forgerock.opendj.config.server.ConfigException - If there is a problem with the provided
configuration entry that would prevent
this entry cache from being used.InitializationException - If a problem occurs during the
initialization process that is
not related to the
configuration.public void finalizeEntryCache()
EntryCachefinalizeEntryCache in class EntryCache<org.forgerock.opendj.server.config.server.EntryCacheCfg>public boolean containsEntry(org.forgerock.opendj.ldap.DN entryDN)
EntryCachecontainsEntry in class EntryCache<org.forgerock.opendj.server.config.server.EntryCacheCfg>entryDN - The DN for which to make the determination.true if the entry cache currently contains the
entry with the specified DN, or false if not.public Entry getEntry(String backendID, long entryID)
EntryCachegetEntry in class EntryCache<org.forgerock.opendj.server.config.server.EntryCacheCfg>backendID - ID of the backend associated with the entry
to retrieve.entryID - The entry ID within the provided backend for
the specified entry.null if it is not present.public Entry getEntry(org.forgerock.opendj.ldap.DN entryDN)
EntryCachegetEntry in class EntryCache<org.forgerock.opendj.server.config.server.EntryCacheCfg>entryDN - The DN of the entry to retrieve.null if it is not present.public long getEntryID(org.forgerock.opendj.ldap.DN entryDN)
EntryCachegetEntryID in class EntryCache<org.forgerock.opendj.server.config.server.EntryCacheCfg>entryDN - The DN of the entry for which to retrieve the
entry ID.public org.forgerock.opendj.ldap.DN getEntryDN(String backendID, long entryID)
EntryCachegetEntryDN in class EntryCache<org.forgerock.opendj.server.config.server.EntryCacheCfg>backendID - ID of the backend associated with the
entry for which to retrieve the entry DN.entryID - The entry ID within the provided backend
for which to retrieve the entry DN.null if it is not present in the cache.public void putEntry(Entry entry, String backendID, long entryID)
EntryCacheputEntry in class EntryCache<org.forgerock.opendj.server.config.server.EntryCacheCfg>entry - The entry to store in the cache.backendID - ID of the backend with which the entry is
associated.entryID - The entry ID within the provided backend that
uniquely identifies the specified entry.public boolean putEntryIfAbsent(Entry entry, String backendID, long entryID)
EntryCacheputEntryIfAbsent in class EntryCache<org.forgerock.opendj.server.config.server.EntryCacheCfg>entry - The entry to store in the cache.backendID - ID of the backend with which the entry is
associated.entryID - The entry ID within the provided backend that
uniquely identifies the specified entry.false if an existing entry or some other problem
prevented the method from completing successfully, or
true if there was no conflict and the entry was
either stored or the cache determined that this entry
should never be cached for some reason.public void removeEntry(org.forgerock.opendj.ldap.DN entryDN)
EntryCacheremoveEntry in class EntryCache<org.forgerock.opendj.server.config.server.EntryCacheCfg>entryDN - The DN of the entry to remove from the cache.public void clear()
EntryCacheclear in class EntryCache<org.forgerock.opendj.server.config.server.EntryCacheCfg>public void clearBackend(String backendID)
EntryCacheclearBackend in class EntryCache<org.forgerock.opendj.server.config.server.EntryCacheCfg>backendID - ID of the backend for which to flush the
associated entries.public void handleLowMemory()
EntryCachehandleLowMemory in class EntryCache<org.forgerock.opendj.server.config.server.EntryCacheCfg>public boolean isConfigurationChangeAcceptable(org.forgerock.opendj.server.config.server.EntryCacheCfg configuration,
List<org.forgerock.i18n.LocalizableMessage> unacceptableReasons)
isConfigurationChangeAcceptable in interface org.forgerock.opendj.config.server.ConfigurationChangeListener<org.forgerock.opendj.server.config.server.EntryCacheCfg>public org.forgerock.opendj.config.server.ConfigChangeResult applyConfigurationChange(org.forgerock.opendj.server.config.server.EntryCacheCfg configuration)
applyConfigurationChange in interface org.forgerock.opendj.config.server.ConfigurationChangeListener<org.forgerock.opendj.server.config.server.EntryCacheCfg>public MonitorData getMonitorData()
EntryCachegetMonitorData in class EntryCache<org.forgerock.opendj.server.config.server.EntryCacheCfg>public Long getCacheCount()
EntryCachegetCacheCount in class EntryCache<org.forgerock.opendj.server.config.server.EntryCacheCfg>public String toVerboseString()
EntryCacheThis method is invoked by unit tests for debugging.
toVerboseString in class EntryCache<org.forgerock.opendj.server.config.server.EntryCacheCfg>null if all maps are empty.public static final EntryCache<? extends org.forgerock.opendj.server.config.server.EntryCacheCfg>[] getCacheOrder()
public static final void setCacheOrder(SortedMap<Integer,EntryCache<? extends org.forgerock.opendj.server.config.server.EntryCacheCfg>> cacheOrderMap)
cacheOrderMap - The current cache order array.public void performBackendPreInitializationProcessing(LocalBackend<?> backend)
performBackendPreInitializationProcessing in interface LocalBackendInitializationListenerbackend - The backend that has been initialized and is
about to be put into service.public void performBackendPostFinalizationProcessing(LocalBackend<?> backend)
performBackendPostFinalizationProcessing in interface LocalBackendInitializationListenerbackend - The backend that has been taken out of service
and is about to be finalized.public void performBackendPostInitializationProcessing(LocalBackend<?> backend)
LocalBackendInitializationListenerperformBackendPostInitializationProcessing in interface LocalBackendInitializationListenerbackend - The backend that has been initialized and has been
put into service.public void performBackendPreFinalizationProcessing(LocalBackend<?> backend)
LocalBackendInitializationListenerperformBackendPreFinalizationProcessing in interface LocalBackendInitializationListenerbackend - The backend that is about to be finalized.Copyright © 2010-2020 Wren Security. All Rights Reserved.