|
|||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||
java.lang.Objectorg.opends.server.api.EntryCache<EntryCacheCfg>
org.opends.server.extensions.DefaultEntryCache
public class DefaultEntryCache
This class defines the default entry cache 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. It does not actually store any entries, so all calls to the entry cache public API are routed to underlying entry cache according to the current configuration order and preferences.
| Field Summary |
|---|
| Fields inherited from class org.opends.server.api.EntryCache |
|---|
cacheHits, cacheMisses |
| Constructor Summary | |
|---|---|
DefaultEntryCache()
Creates a new instance of this default entry cache. |
|
| Method Summary | |
|---|---|
ConfigChangeResult |
applyConfigurationChange(EntryCacheCfg configuration)
Applies the configuration changes to this change listener. |
void |
clear()
Removes all entries from the cache. |
void |
clearBackend(Backend backend)
Removes all entries from the cache that are associated with the provided backend. |
void |
clearSubtree(DN baseDN)
Removes all entries from the cache that are below the provided DN. |
boolean |
containsEntry(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. |
java.lang.Long |
getCacheCount()
Retrieves the current number of entries stored within the cache. |
EntryCache<? extends EntryCacheCfg>[] |
getCacheOrder()
Retrieves the current cache order array. |
Entry |
getEntry(Backend backend,
long entryID,
LockType lockType,
java.util.List<java.util.concurrent.locks.Lock> lockList)
Retrieves the requested entry if it is present in the cache, obtaining a lock on the entry before it is returned. |
Entry |
getEntry(DN entryDN)
Retrieves the entry with the specified DN from the cache. |
Entry |
getEntry(DN entryDN,
LockType lockType,
java.util.List<java.util.concurrent.locks.Lock> lockList)
Retrieves the entry with the specified DN from the cache, obtaining a lock on the entry before it is returned. |
DN |
getEntryDN(Backend backend,
long entryID)
Retrieves the entry DN for the entry with the specified ID on the specific backend from the cache. |
long |
getEntryID(DN entryDN)
Retrieves the entry ID for the entry with the specified DN from the cache. |
java.util.ArrayList<Attribute> |
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(EntryCacheCfg configEntry)
Initializes this entry cache implementation so that it will be available for storing and retrieving entries. |
boolean |
isConfigurationChangeAcceptable(EntryCacheCfg configuration,
java.util.List<Message> unacceptableReasons)
Indicates whether the proposed change to the configuration is acceptable to this change listener. |
void |
performBackendFinalizationProcessing(Backend backend)
Performs any processing that may be required whenever a backend is finalized. |
void |
performBackendInitializationProcessing(Backend backend)
Performs any processing that may be required whenever a backend is initialized for use in the Directory Server. |
void |
putEntry(Entry entry,
Backend backend,
long entryID)
Stores the provided entry in the cache. |
boolean |
putEntryIfAbsent(Entry entry,
Backend backend,
long entryID)
Stores the provided entry in the cache only if it does not conflict with an entry that already exists. |
void |
removeEntry(DN entryDN)
Removes the specified entry from the cache. |
void |
setCacheOrder(java.util.SortedMap<java.lang.Integer,EntryCache<? extends EntryCacheCfg>> cacheOrderMap)
Sets the current cache order array. |
| Methods inherited from class org.opends.server.api.EntryCache |
|---|
filtersAllowCaching, getCacheHits, getCacheMisses, getEntryCacheMonitor, getExcludeFilters, getIncludeFilters, getLockTimeout, isConfigurationAcceptable, setEntryCacheMonitor, setExcludeFilters, setIncludeFilters, setLockTimeout |
| Methods inherited from class java.lang.Object |
|---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
| Constructor Detail |
|---|
public DefaultEntryCache()
| Method Detail |
|---|
public void initializeEntryCache(EntryCacheCfg configEntry)
throws ConfigException,
InitializationException
initializeEntryCache in class EntryCache<EntryCacheCfg>configEntry - The configuration to use to initialize
the entry cache.
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()
finalizeEntryCache in class EntryCache<EntryCacheCfg>public boolean containsEntry(DN entryDN)
containsEntry in class EntryCache<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(DN entryDN,
LockType lockType,
java.util.List<java.util.concurrent.locks.Lock> lockList)
getEntry in class EntryCache<EntryCacheCfg>entryDN - The DN of the entry to retrieve.lockType - The type of lock to obtain (it may be
NONE).lockList - The list to which the obtained lock will be
added (note that no lock will be added if the
lock type was NONE).
null if it is not present.
public Entry getEntry(Backend backend,
long entryID,
LockType lockType,
java.util.List<java.util.concurrent.locks.Lock> lockList)
getEntry in class EntryCache<EntryCacheCfg>backend - The backend associated with the entry to
retrieve.entryID - The entry ID within the provided backend for
the specified entry.lockType - The type of lock to obtain (it may be
NONE).lockList - The list to which the obtained lock will be
added (note that no lock will be added if the
lock type was NONE).
null if it is not present.public Entry getEntry(DN entryDN)
getEntry in class EntryCache<EntryCacheCfg>entryDN - The DN of the entry to retrieve.
null if it is not present.public long getEntryID(DN entryDN)
getEntryID in class EntryCache<EntryCacheCfg>entryDN - The DN of the entry for which to retrieve the
entry ID.
public DN getEntryDN(Backend backend,
long entryID)
getEntryDN in class EntryCache<EntryCacheCfg>backend - 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,
Backend backend,
long entryID)
putEntry in class EntryCache<EntryCacheCfg>entry - The entry to store in the cache.backend - 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,
Backend backend,
long entryID)
putEntryIfAbsent in class EntryCache<EntryCacheCfg>entry - The entry to store in the cache.backend - 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(DN entryDN)
removeEntry in class EntryCache<EntryCacheCfg>entryDN - The DN of the entry to remove from the cache.public void clear()
clear in class EntryCache<EntryCacheCfg>public void clearBackend(Backend backend)
clearBackend in class EntryCache<EntryCacheCfg>backend - The backend for which to flush the associated
entries.public void clearSubtree(DN baseDN)
clearSubtree in class EntryCache<EntryCacheCfg>baseDN - The base DN below which all entries should be
flushed.public void handleLowMemory()
handleLowMemory in class EntryCache<EntryCacheCfg>
public boolean isConfigurationChangeAcceptable(EntryCacheCfg configuration,
java.util.List<Message> unacceptableReasons)
isConfigurationChangeAcceptable in interface ConfigurationChangeListener<EntryCacheCfg>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.
true if the proposed change is
acceptable, or false if it is not.public ConfigChangeResult applyConfigurationChange(EntryCacheCfg configuration)
applyConfigurationChange in interface ConfigurationChangeListener<EntryCacheCfg>configuration - The new configuration containing the changes.
public java.util.ArrayList<Attribute> getMonitorData()
getMonitorData in class EntryCache<EntryCacheCfg>public java.lang.Long getCacheCount()
getCacheCount in class EntryCache<EntryCacheCfg>public final EntryCache<? extends EntryCacheCfg>[] getCacheOrder()
public final void setCacheOrder(java.util.SortedMap<java.lang.Integer,EntryCache<? extends EntryCacheCfg>> cacheOrderMap)
cacheOrderMap - The current cache order array.public void performBackendInitializationProcessing(Backend backend)
performBackendInitializationProcessing in interface BackendInitializationListenerbackend - The backend that has been initialized and is
about to be put into service.public void performBackendFinalizationProcessing(Backend backend)
performBackendFinalizationProcessing in interface BackendInitializationListenerbackend - The backend that has been taken out of service
and is about to be finalized.
|
|||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||