public class FIFOEntryCache extends EntryCache<org.forgerock.opendj.server.config.server.FifoEntryCacheCfg> implements org.forgerock.opendj.config.server.ConfigurationChangeListener<org.forgerock.opendj.server.config.server.FifoEntryCacheCfg>
cacheHits, cacheMisses
Constructor and Description |
---|
FIFOEntryCache()
Creates a new instance of this FIFO entry cache.
|
Modifier and Type | Method and Description |
---|---|
org.forgerock.opendj.config.server.ConfigChangeResult |
applyConfigurationChange(org.forgerock.opendj.server.config.server.FifoEntryCacheCfg 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.
|
Entry |
getEntry(org.forgerock.opendj.ldap.Dn entryDN)
Retrieves the entry with the specified DN from 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.FifoEntryCacheCfg configuration)
Initializes this entry cache implementation so that it will be
available for storing and retrieving entries.
|
boolean |
isConfigurationAcceptable(org.forgerock.opendj.server.config.server.EntryCacheCfg configuration,
List<LocalizableMessage> unacceptableReasons)
Indicates whether the provided configuration is acceptable for
this entry cache.
|
boolean |
isConfigurationChangeAcceptable(org.forgerock.opendj.server.config.server.FifoEntryCacheCfg configuration,
List<LocalizableMessage> unacceptableReasons) |
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.
|
String |
toVerboseString()
Return a verbose string representation of the current cache maps.
|
filtersAllowCaching, getCacheHits, getCacheMisses, getEntry, getEntryCacheMonitor, getExcludeFilters, getIncludeFilters, setEntryCacheMonitor, setExcludeFilters, setIncludeFilters
public FIFOEntryCache()
public void initializeEntryCache(ServerContext serverContext, org.forgerock.opendj.server.config.server.FifoEntryCacheCfg configuration) throws org.forgerock.opendj.config.server.ConfigException, InitializationException
EntryCache
initializeEntryCache
in class EntryCache<org.forgerock.opendj.server.config.server.FifoEntryCacheCfg>
serverContext
- The server context.configuration
- 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()
EntryCache
finalizeEntryCache
in class EntryCache<org.forgerock.opendj.server.config.server.FifoEntryCacheCfg>
public boolean containsEntry(org.forgerock.opendj.ldap.Dn entryDN)
EntryCache
containsEntry
in class EntryCache<org.forgerock.opendj.server.config.server.FifoEntryCacheCfg>
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(org.forgerock.opendj.ldap.Dn entryDN)
EntryCache
getEntry
in class EntryCache<org.forgerock.opendj.server.config.server.FifoEntryCacheCfg>
entryDN
- The DN of the entry to retrieve.null
if it is not present.public long getEntryID(org.forgerock.opendj.ldap.Dn entryDN)
EntryCache
getEntryID
in class EntryCache<org.forgerock.opendj.server.config.server.FifoEntryCacheCfg>
entryDN
- The DN of the entry for which to retrieve the
entry ID.public org.forgerock.opendj.ldap.Dn getEntryDN(String backendID, long entryID)
EntryCache
getEntryDN
in class EntryCache<org.forgerock.opendj.server.config.server.FifoEntryCacheCfg>
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)
EntryCache
putEntry
in class EntryCache<org.forgerock.opendj.server.config.server.FifoEntryCacheCfg>
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)
EntryCache
putEntryIfAbsent
in class EntryCache<org.forgerock.opendj.server.config.server.FifoEntryCacheCfg>
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)
EntryCache
removeEntry
in class EntryCache<org.forgerock.opendj.server.config.server.FifoEntryCacheCfg>
entryDN
- The DN of the entry to remove from the cache.public void clear()
EntryCache
clear
in class EntryCache<org.forgerock.opendj.server.config.server.FifoEntryCacheCfg>
public void clearBackend(String backendID)
EntryCache
clearBackend
in class EntryCache<org.forgerock.opendj.server.config.server.FifoEntryCacheCfg>
backendID
- ID of the backend for which to flush the
associated entries.public void handleLowMemory()
EntryCache
handleLowMemory
in class EntryCache<org.forgerock.opendj.server.config.server.FifoEntryCacheCfg>
public boolean isConfigurationAcceptable(org.forgerock.opendj.server.config.server.EntryCacheCfg configuration, List<LocalizableMessage> unacceptableReasons)
EntryCache
isConfigurationAcceptable
in class EntryCache<org.forgerock.opendj.server.config.server.FifoEntryCacheCfg>
configuration
- The entry cache configuration for
which to make the determination.unacceptableReasons
- A list that may be used to hold the
reasons that the provided
configuration is not acceptable.true
if the provided configuration is acceptable
for this entry cache, or false
if not.public boolean isConfigurationChangeAcceptable(org.forgerock.opendj.server.config.server.FifoEntryCacheCfg configuration, List<LocalizableMessage> unacceptableReasons)
isConfigurationChangeAcceptable
in interface org.forgerock.opendj.config.server.ConfigurationChangeListener<org.forgerock.opendj.server.config.server.FifoEntryCacheCfg>
public org.forgerock.opendj.config.server.ConfigChangeResult applyConfigurationChange(org.forgerock.opendj.server.config.server.FifoEntryCacheCfg configuration)
applyConfigurationChange
in interface org.forgerock.opendj.config.server.ConfigurationChangeListener<org.forgerock.opendj.server.config.server.FifoEntryCacheCfg>
public MonitorData getMonitorData()
EntryCache
getMonitorData
in class EntryCache<org.forgerock.opendj.server.config.server.FifoEntryCacheCfg>
public Long getCacheCount()
EntryCache
getCacheCount
in class EntryCache<org.forgerock.opendj.server.config.server.FifoEntryCacheCfg>
public String toVerboseString()
EntryCache
This method is invoked by unit tests for debugging.
toVerboseString
in class EntryCache<org.forgerock.opendj.server.config.server.FifoEntryCacheCfg>
null
if all maps are empty.Copyright © 2010-2017 ForgeRock AS. All Rights Reserved.