Class EntryCacheCommon


  • public class EntryCacheCommon
    extends Object
    This class provides some common tools to all entry cache implementations.
    • Constructor Detail

      • EntryCacheCommon

        public EntryCacheCommon()
    • 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 filters
        decodeErrorMsg - the error message ID to use in case of error
        errorHandler - error handler to report filter decoding errors on
        configEntryDN - 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 used
        unacceptableReasons - 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 that null can 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.