Package org.opends.server.extensions
Class EntryCacheCommon
- java.lang.Object
-
- org.opends.server.extensions.EntryCacheCommon
-
public class EntryCacheCommon extends Object
This class provides some common tools to all entry cache implementations.
-
-
Nested Class Summary
Nested Classes Modifier and Type Class Description static classEntryCacheCommon.ConfigErrorHandlerError handler used by local methods to report configuration error.static classEntryCacheCommon.ConfigPhaseConfiguration phases.
-
Constructor Summary
Constructors Constructor Description EntryCacheCommon()
-
Method Summary
All Methods Static Methods Concrete Methods Modifier and Type Method Description static EntryCacheCommon.ConfigErrorHandlergetConfigErrorHandler(EntryCacheCommon.ConfigPhase configPhase, List<org.forgerock.i18n.LocalizableMessage> unacceptableReasons, List<org.forgerock.i18n.LocalizableMessage> errorMessages)Create a new error handler.static Set<SearchFilter>getFilters(SortedSet<String> filters, org.forgerock.i18n.LocalizableMessageDescriptor.Arg3<Object,Object,Object> decodeErrorMsg, EntryCacheCommon.ConfigErrorHandler errorHandler, DN configEntryDN)Reads a list of string filters and convert it to a list of search filters.static MonitorDatagetGenericMonitorData(Long cacheHits, Long cacheMisses, Long cacheSize, Long maxCacheSize, Long cacheCount, Long maxCacheCount)Constructs a set of generic attributes containing entry cache monitor data.
-
-
-
Method Detail
-
getFilters
public static Set<SearchFilter> getFilters(SortedSet<String> filters, org.forgerock.i18n.LocalizableMessageDescriptor.Arg3<Object,Object,Object> decodeErrorMsg, EntryCacheCommon.ConfigErrorHandler errorHandler, DN configEntryDN)
Reads a list of string filters and convert it to a list of search filters.- Parameters:
filters- the list of string filter to convert to search filtersdecodeErrorMsg- the error message ID to use in case of errorerrorHandler- error handler to report filter decoding errors onconfigEntryDN- the entry cache configuration DN- Returns:
- the set of search filters
-
getConfigErrorHandler
public static EntryCacheCommon.ConfigErrorHandler getConfigErrorHandler(EntryCacheCommon.ConfigPhase configPhase, List<org.forgerock.i18n.LocalizableMessage> unacceptableReasons, List<org.forgerock.i18n.LocalizableMessage> errorMessages)
Create a new error handler.- Parameters:
configPhase- the configuration phase for which the error handler is usedunacceptableReasons- the reasons why the configuration cannot be applied (during PHASE_ACCEPTABLE phase)errorMessages- the errors found when applying a new configuration (during PHASE_APPLY phase)- Returns:
- a new configuration error handler
-
getGenericMonitorData
public static MonitorData getGenericMonitorData(Long cacheHits, Long cacheMisses, Long cacheSize, Long maxCacheSize, Long cacheCount, Long maxCacheCount)
Constructs a set of generic attributes containing entry cache monitor data. Note thatnullcan be passed in place of any argument to denote the argument is omitted, such is when no state data of a given kind is available or can be provided.- Parameters:
cacheHits- number of cache hits.cacheMisses- number of cache misses.cacheSize- size of the current cache, in bytes.maxCacheSize- maximum allowed cache size, in bytes.cacheCount- number of entries stored in the cache.maxCacheCount- maximum number of cache entries allowed.- Returns:
- A set of generic attributes containing monitor data.
-
-