From a9b73c46ed8c7eb9106027beb4fcbf8f192a7118 Mon Sep 17 00:00:00 2001
From: abobrov <abobrov@localhost>
Date: Tue, 04 Sep 2007 16:01:28 +0000
Subject: [PATCH] entry cache cleanup: - remove obsolete methods, fields and messages. - aggregate filters evaluation for config phases. - simplify filters evaluation and error reporting. - use a single set of filter messages.

---
 opendj-sdk/opends/src/server/org/opends/server/extensions/SoftReferenceEntryCache.java |   49 ----
 opendj-sdk/opends/src/messages/messages/extension.properties                           |  223 +------------------
 opendj-sdk/opends/src/server/org/opends/server/extensions/FIFOEntryCache.java          |  133 -----------
 opendj-sdk/opends/src/server/org/opends/server/extensions/FileSystemEntryCache.java    |  127 ----------
 opendj-sdk/opends/src/messages/messages/config.properties                              |   59 -----
 opendj-sdk/opends/src/server/org/opends/server/extensions/EntryCacheCommon.java        |   41 ---
 6 files changed, 46 insertions(+), 586 deletions(-)

diff --git a/opendj-sdk/opends/src/messages/messages/config.properties b/opendj-sdk/opends/src/messages/messages/config.properties
index ad45acc..043c4d9 100644
--- a/opendj-sdk/opends/src/messages/messages/config.properties
+++ b/opendj-sdk/opends/src/messages/messages/config.properties
@@ -695,65 +695,16 @@
  error occurred that prevented the server from installing a temporary default \
  entry cache for use until the actual cache could be created from the \
  configuration:  %s
-SEVERE_ERR_CONFIG_ENTRYCACHE_CANNOT_GET_CONFIG_ENTRY_201=An unexpected error \
- occurred while attempting to get the "cn=Entry Cache,cn=config" entry, which \
- holds the entry cache configuration:  %s.  No entry cache will be available
-SEVERE_WARN_CONFIG_ENTRYCACHE_NO_CONFIG_ENTRY_202=The entry cache \
+SEVERE_WARN_CONFIG_ENTRYCACHE_NO_CONFIG_ENTRY_201=The entry cache \
  configuration entry "cn=Entry Cache,cn=config" does not exist in the \
  Directory Server configuration.  No entry cache will be available until this \
  entry is created with a valid entry cache configuration
-SEVERE_ERR_CONFIG_ENTRYCACHE_CANNOT_REGISTER_ADD_LISTENER_203=An error \
- occurred while attempting to register an add listener to watch for the entry \
- cache configuration entry to be created:  %s.  If an entry cache \
- configuration is added while the server is online, it will not be detected \
- until the server is restarted
-SEVERE_ERR_CONFIG_ENTRYCACHE_CANNOT_REGISTER_DELETE_LISTENER_204=An error \
- occurred while attempting to register a delete listener to watch for the \
- entry cache configuration entry to be deleted: %s.  If the entry cache \
- configuration entry is deleted while the server is online, it will not be \
- detected until the server is restarted
-SEVERE_ERR_CONFIG_ENTRYCACHE_DESCRIPTION_CACHE_ENABLED_205=Indicates whether \
- the Directory Server entry cache should be enabled.  If the entry cache is \
- enabled, it may significantly improve performance by allowing \
- previously-accessed entries to be retrieved from memory rather than needing \
- to access the backend repository.  Changes to this configuration attribute \
- will take effect immediately, but will have the side effect of clearing the \
- cache contents, which may result in degraded performance for a period of time
-SEVERE_ERR_CONFIG_ENTRYCACHE_NO_ENABLED_ATTR_206=Configuration entry \
- "cn=Entry Cache,cn=config" does not contain a value for attribute \
- ds-cfg-entry-cache-enabled, which indicates whether the entry cache is \
- enabled for use in the server.  As a result, the cache will be disabled
-SEVERE_ERR_CONFIG_ENTRYCACHE_DISABLED_207=The Directory Server entry cache \
- configured in entry "cn=Entry Cache,cn=config" has been disabled.  No entry \
- cache will be available within the server
-SEVERE_ERR_CONFIG_ENTRYCACHE_UNABLE_TO_DETERMINE_ENABLED_STATE_208=An \
- unexpected error occurred while attempting to determine whether the entry \
- cache configured in entry "cn=Entry Cache,cn=config" is enabled:  %s.  As a \
- result, the entry cache will be disabled
-SEVERE_ERR_CONFIG_ENTRYCACHE_DESCRIPTION_CACHE_CLASS_209=Specifies the \
- fully-qualified name of the Java class that should provide the entry cache \
- implementation.  Changes to this configuration attribute will take effect \
- immediately, but will have the side effect of clearing the cache contents, \
- which may result in degraded performance for a period of time
-SEVERE_ERR_CONFIG_ENTRYCACHE_NO_CLASS_ATTR_210=Configuration entry "cn=Entry \
- Cache,cn=config" does not contain a value for attribute \
- ds-cfg-entry-cache-class", which specifies the class name for the entry cache \
- implementation.  As a result, the entry cache will be disabled
-SEVERE_ERR_CONFIG_ENTRYCACHE_CANNOT_DETERMINE_CLASS_211=An unexpected error \
- occurred while attempting to determine the value of the \
- ds-cfg-entry-cache-class attribute in configuration entry "cn=Entry \
- Cache,cn=config":  %s.  The entry cache will be disabled
-SEVERE_ERR_CONFIG_ENTRYCACHE_CANNOT_LOAD_CLASS_212=The class %s defined in \
- attribute ds-cfg-entry-cache-class of configuration entry "cn=Entry \
- Cache,cn=config" could not be loaded:  %s.  The entry cache will be disabled
-SEVERE_ERR_CONFIG_ENTRYCACHE_CANNOT_INSTANTIATE_CLASS_213=The class %s \
- defined in attribute ds-cfg-entry-cache-class of configuration entry \
- "cn=Entry Cache,cn=config" could not be instantiated as a Directory Server \
- entry cache:  %s.  As a result, the entry cache will be disabled
-SEVERE_ERR_CONFIG_ENTRYCACHE_CANNOT_INITIALIZE_CACHE_214=An error occurred \
+SEVERE_ERR_CONFIG_ENTRYCACHE_CANNOT_INITIALIZE_CACHE_202=An error occurred \
  while attempting to initialize an instance of class %s for use as the \
  Directory Server entry cache:  %s.  As a result, the entry cache will be \
  disabled
+SEVERE_ERR_CONFIG_ENTRYCACHE_CONFIG_NOT_ACCEPTABLE_203=The configuration for \
+ the entry cache defined in configuration entry %s was not acceptable:  %s
 MILD_ERR_CONFIG_ENTRY_CANNOT_REMOVE_CHILD_215=An unexpected error occurred \
  while attempting to remove entry %s as a child of configuration entry %s:  %s
 SEVERE_WARN_CONFIG_SCHEMA_CANNOT_PARSE_NAME_FORM_216=Unable to parse a name \
@@ -2097,8 +2048,6 @@
 MILD_ERR_CONFIG_CERTMAPPER_CONFIG_NOT_ACCEPTABLE_684=The configuration for \
  the certificate mapper defined in configuration entry %s was not acceptable: \
  %s
-MILD_ERR_CONFIG_ENTRYCACHE_CONFIG_NOT_ACCEPTABLE_685=The configuration for \
- the entry cache defined in configuration entry %s was not acceptable:  %s
 MILD_ERR_CONFIG_GROUP_CONFIG_NOT_ACCEPTABLE_686=The configuration for the \
  group implementation defined in configuration entry %s was not acceptable: \
  %s
diff --git a/opendj-sdk/opends/src/messages/messages/extension.properties b/opendj-sdk/opends/src/messages/messages/extension.properties
index e31c424..9fede71 100644
--- a/opendj-sdk/opends/src/messages/messages/extension.properties
+++ b/opendj-sdk/opends/src/messages/messages/extension.properties
@@ -60,113 +60,18 @@
 MILD_ERR_PWSCHEME_CANNOT_ENCODE_PASSWORD_5=An unexpected error occurred while \
  attempting to encode a password using the storage scheme defined in class %s: \
  %s
-INFO_FIFOCACHE_DESCRIPTION_MAX_MEMORY_PCT_6=Specifies the maximum percentage \
- of available memory in the JVM that the entry cache should be allowed to \
- consume.  Its value should be an integer between 1 and 100.  Changes to this \
- configuration attribute will take effect immediately, although if the value \
- is reduced to a percentage that is less than the current consumption in the \
- JVM, it may take some time for existing cache items to be purged
-SEVERE_ERR_FIFOCACHE_CANNOT_DETERMINE_MAX_MEMORY_PCT_7=An error occurred \
- while attempting to determine the value of the ds-cfg-max-memory-percent \
- attribute in configuration entry %s:  %s.  The default of %d will be used
-INFO_FIFOCACHE_DESCRIPTION_MAX_ENTRIES_8=Specifies the maximum number of \
- entries that may be held in the entry cache, with a value of zero indicating \
- that there should be no limit to the number of entries (although the memory \
- percentage will still be observed).  Changes to this configuration attribute \
- will take effect immediately, although if it is reduced to a value that is \
- less than the number of entries currently held in the cache, it may take some \
- time for existing cache items to be purged
-SEVERE_ERR_FIFOCACHE_CANNOT_DETERMINE_MAX_ENTRIES_9=An error occurred while \
- attempting to determine the value of the ds-cfg-max-entries attribute in \
- configuration entry %s:  %s.  No hard limit on the number of entries will be \
- enforced, but the value of ds-cfg-max-memory-percent will still be observed
-INFO_FIFOCACHE_DESCRIPTION_LOCK_TIMEOUT_10=Specifies the maximum length of \
- time in milliseconds that the entry cache should block while attempting to \
- acquire a lock for an entry.  Changes to this configuration attribute will \
- take effect immediately
-SEVERE_ERR_FIFOCACHE_CANNOT_DETERMINE_LOCK_TIMEOUT_11=An error occurred while \
- attempting to determine the value of the ds-cfg-lock-timeout attribute in \
- configuration entry %s:  %s.  The default of %d will be used
-INFO_FIFOCACHE_DESCRIPTION_INCLUDE_FILTERS_12=Specifies a set of search \
- filters that may be used to indicate which entries should be included in the \
- entry cache.  Entries that do not match at least one of these filters will \
- not be stored in the cache.  If no filters are provided, then any entry will \
- be accepted.  Changes to this configuration attribute will take effect \
- immediately, but will not impact existing entries that are already held in \
- the cache
-SEVERE_WARN_FIFOCACHE_CANNOT_DECODE_INCLUDE_FILTER_13=An error occurred while \
- attempting to decode the value "%s" from attribute ds-cfg-include-filter of \
- entry %s:  %s.  This filter will not be used when determining whether to \
- store an entry in the cache
-SEVERE_WARN_FIFOCACHE_CANNOT_DECODE_ANY_INCLUDE_FILTERS_14=An error occurred \
- while attempting to decode any of the values from attribute \
- ds-cfg-include-filter of entry %s.  All entries will be considered eligible \
- for inclusion in the cache
-SEVERE_ERR_FIFOCACHE_CANNOT_DETERMINE_INCLUDE_FILTERS_15=An error occurred \
- while attempting to determine the value of the ds-cfg-include-filter \
- attribute in configuration entry %s:  %s.  All entries will be considered \
- eligible for inclusion in the cache
-INFO_FIFOCACHE_DESCRIPTION_EXCLUDE_FILTERS_16=Specifies a set of search \
- filters that may be used to indicate which entries should be excluded from \
- the entry cache.  Entries that match any of these filters will not be stored \
- in the cache.  If no filters are provided, then any entry will be accepted. \
- Changes to this configuration attribute will take effect immediately, but \
- will not impact existing entries that are already held in the cache
-SEVERE_WARN_FIFOCACHE_CANNOT_DECODE_EXCLUDE_FILTER_17=An error occurred while \
- attempting to decode the value "%s" from attribute ds-cfg-exclude-filter of \
- entry %s:  %s.  This filter will not be used when determining whether to \
- store an entry in the cache
-SEVERE_WARN_FIFOCACHE_CANNOT_DECODE_ANY_EXCLUDE_FILTERS_18=An error occurred \
- while attempting to decode any of the values from attribute \
- ds-cfg-exclude-filter of entry %s.  All entries will be considered eligible \
- for inclusion in the cache
-SEVERE_ERR_FIFOCACHE_CANNOT_DETERMINE_EXCLUDE_FILTERS_19=An error occurred \
- while attempting to determine the value of the ds-cfg-exclude-filter \
- attribute in configuration entry %s:  %s.  All entries will be considered \
- eligible for inclusion in the cache
-FATAL_ERR_FIFOCACHE_CANNOT_INITIALIZE_20=A fatal error occurred while trying \
+SEVERE_ERR_CACHE_INVALID_INCLUDE_FILTER_6=The ds-cfg-include-filter \
+ attribute of configuration entry %s, which specifies a set of search filters \
+ that may be used to control which entries are included in the cache, has an \
+ invalid value of "%s":  %s
+SEVERE_ERR_CACHE_INVALID_EXCLUDE_FILTER_7=The ds-cfg-exclude-filter \
+ attribute of configuration entry %s, which specifies a set of search filters \
+ that may be used to control which entries are excluded from the cache, has an \
+ invalid value of "%s":  %s
+FATAL_ERR_FIFOCACHE_CANNOT_INITIALIZE_8=A fatal error occurred while trying \
  to initialize fifo entry cache:  %s
-SEVERE_ERR_FIFOCACHE_INVALID_MAX_ENTRIES_21=The ds-cfg-max-entries attribute \
- of entry %s, which specifies the maximum number of entries that may be held \
- in the entry cache, has an invalid value:  %s.  Its value must be a positive \
- integer, or zero to indicate that no limit should be enforced
-SEVERE_ERR_FIFOCACHE_INVALID_LOCK_TIMEOUT_22=The ds-cfg-lock-timeout \
- attribute of entry %s, which specifies the maximum length of time in \
- milliseconds that the cache should block while attempting to obtain a lock on \
- an entry, has an invalid value:  %s.  Its value must be a positive integer, \
- or zero to indicate that it should never block
-SEVERE_ERR_FIFOCACHE_INVALID_INCLUDE_FILTER_23=The ds-cfg-include-filter \
- attribute of entry %s, which specifies a set of search filters that may be \
- used to control which entries are included in the cache, has an invalid value \
- of "%s":  %s
-SEVERE_ERR_FIFOCACHE_INVALID_INCLUDE_FILTERS_24=The ds-cfg-include-filter \
- attribute of entry %s, which specifies a set of search filters that may be \
- used to control which entries are included in the cache, has an invalid \
- value:  %s
-SEVERE_ERR_FIFOCACHE_INVALID_EXCLUDE_FILTER_25=The ds-cfg-exclude-filter \
- attribute of entry %s, which specifies a set of search filters that may be \
- used to control which entries are excluded from the cache, has an invalid \
- value of "%s":  %s
-SEVERE_ERR_FIFOCACHE_INVALID_EXCLUDE_FILTERS_26=The ds-cfg-exclude-filter \
- attribute of entry %s, which specifies a set of search filters that may be \
- used to control which entries are excluded from the cache, has an invalid \
- value:  %s
-INFO_FIFOCACHE_UPDATED_MAX_MEMORY_PCT_27=The amount of memory that may be \
- used for the entry cache has been updated to %d percent of the total memory \
- available to the JVM, or approximately %d bytes.  If this percentage has been \
- reduced, it may take some time for entries to be purged so that the current \
- cache memory consumption can reflect this new setting
-INFO_FIFOCACHE_UPDATED_MAX_ENTRIES_28=The number of entries that may be held \
- in the entry cache has been updated to %d.  If this value has been reduced, \
- it may take some time for entries to be purged so that the cache can reflect \
- this new setting
-INFO_FIFOCACHE_UPDATED_LOCK_TIMEOUT_29=The lock timeout that will be used to \
- determine the length of time that the cache should block while attempting to \
- acquire a lock for an entry has been set to %d milliseconds
-INFO_FIFOCACHE_UPDATED_INCLUDE_FILTERS_30=The set of search filters that will \
- control which entries may be included in the cache has been updated
-INFO_FIFOCACHE_UPDATED_EXCLUDE_FILTERS_31=The set of search filters that will \
- control which entries should be be excluded from the cache has been updated
+FATAL_ERR_SOFTREFCACHE_CANNOT_INITIALIZE_9=A fatal error occurred while \
+ trying to initialize soft reference entry cache:  %s
 MILD_ERR_EXTOP_PASSMOD_ILLEGAL_REQUEST_ELEMENT_TYPE_32=The password modify \
  extended request sequence included an ASN.1 element of an invalid type:  %s
 MILD_ERR_EXTOP_PASSMOD_CANNOT_DECODE_REQUEST_33=An unexpected error occurred \
@@ -967,78 +872,6 @@
  GSSAPI authentication
 SEVERE_ERR_EXTOP_WHOAMI_PROXYAUTH_INSUFFICIENT_PRIVILEGES_277=You do not have \
  sufficient privileges to use the proxied authorization control
-INFO_SOFTREFCACHE_DESCRIPTION_LOCK_TIMEOUT_278=Specifies the maximum length \
- of time in milliseconds that the entry cache should block while attempting to \
- acquire a lock for an entry.  Changes to this configuration attribute will \
- take effect immediately
-FATAL_ERR_SOFTREFCACHE_CANNOT_INITIALIZE_279=A fatal error occurred while \
- trying to initialize soft reference entry cache:  %s
-INFO_SOFTREFCACHE_DESCRIPTION_INCLUDE_FILTERS_280=Specifies a set of search \
- filters that may be used to indicate which entries should be included in the \
- entry cache.  Entries that do not match at least one of these filters will \
- not be stored in the cache.  If no filters are provided, then any entry will \
- be accepted.  Changes to this configuration attribute will take effect \
- immediately, but will not impact existing entries that are already held in \
- the cache
-SEVERE_WARN_SOFTREFCACHE_CANNOT_DECODE_INCLUDE_FILTER_281=An error occurred \
- while attempting to decode the value "%s" from attribute \
- ds-cfg-include-filter of entry %s:  %s.  This filter will not be used when \
- determining whether to store an entry in the cache
-SEVERE_WARN_SOFTREFCACHE_CANNOT_DECODE_ANY_INCLUDE_FILTERS_282=An error \
- occurred while attempting to decode any of the values from attribute \
- ds-cfg-include-filter of entry %s.  All entries will be considered eligible \
- for inclusion in the cache
-SEVERE_ERR_SOFTREFCACHE_CANNOT_DETERMINE_INCLUDE_FILTERS_283=An error \
- occurred while attempting to determine the value of the ds-cfg-include-filter \
- attribute in configuration entry %s:  %s.  All entries will be considered \
- eligible for inclusion in the cache
-INFO_SOFTREFCACHE_DESCRIPTION_EXCLUDE_FILTERS_284=Specifies a set of search \
- filters that may be used to indicate which entries should be excluded from \
- the entry cache.  Entries that match any of these filters will not be stored \
- in the cache.  If no filters are provided, then any entry will be accepted. \
- Changes to this configuration attribute will take effect immediately, but \
- will not impact existing entries that are already held in the cache
-SEVERE_WARN_SOFTREFCACHE_CANNOT_DECODE_EXCLUDE_FILTER_285=An error occurred \
- while attempting to decode the value "%s" from attribute \
- ds-cfg-exclude-filter of entry %s:  %s.  This filter will not be used when \
- determining whether to store an entry in the cache
-SEVERE_WARN_SOFTREFCACHE_CANNOT_DECODE_ANY_EXCLUDE_FILTERS_286=An error \
- occurred while attempting to decode any of the values from attribute \
- ds-cfg-exclude-filter of entry %s.  All entries will be considered eligible \
- for inclusion in the cache
-SEVERE_ERR_SOFTREFCACHE_CANNOT_DETERMINE_EXCLUDE_FILTERS_287=An error \
- occurred while attempting to determine the value of the ds-cfg-exclude-filter \
- attribute in configuration entry %s:  %s.  All entries will be considered \
- eligible for inclusion in the cache
-SEVERE_ERR_SOFTREFCACHE_INVALID_LOCK_TIMEOUT_288=The ds-cfg-lock-timeout \
- attribute of entry %s, which specifies the maximum length of time in \
- milliseconds that the cache should block while attempting to obtain a lock on \
- an entry, has an invalid value:  %s.  Its value must be a positive integer, \
- or zero to indicate that it should never block
-SEVERE_ERR_SOFTREFCACHE_INVALID_INCLUDE_FILTER_289=The ds-cfg-include-filter \
- attribute of entry %s, which specifies a set of search filters that may be \
- used to control which entries are included in the cache, has an invalid value \
- of "%s":  %s
-SEVERE_ERR_SOFTREFCACHE_INVALID_INCLUDE_FILTERS_290=The ds-cfg-include-filter \
- attribute of entry %s, which specifies a set of search filters that may be \
- used to control which entries are included in the cache, has an invalid \
- value:  %s
-SEVERE_ERR_SOFTREFCACHE_INVALID_EXCLUDE_FILTER_291=The ds-cfg-exclude-filter \
- attribute of entry %s, which specifies a set of search filters that may be \
- used to control which entries are excluded from the cache, has an invalid \
- value of "%s":  %s
-SEVERE_ERR_SOFTREFCACHE_INVALID_EXCLUDE_FILTERS_292=The ds-cfg-exclude-filter \
- attribute of entry %s, which specifies a set of search filters that may be \
- used to control which entries are excluded from the cache, has an invalid \
- value:  %s
-INFO_SOFTREFCACHE_UPDATED_LOCK_TIMEOUT_293=The lock timeout that will be used \
- to determine the length of time that the cache should block while attempting \
- to acquire a lock for an entry has been set to %d milliseconds
-INFO_SOFTREFCACHE_UPDATED_INCLUDE_FILTERS_294=The set of search filters that \
- will control which entries may be included in the cache has been updated
-INFO_SOFTREFCACHE_UPDATED_EXCLUDE_FILTERS_295=The set of search filters that \
- will control which entries should be be excluded from the cache has been \
- updated
 INFO_EXACTMAP_DESCRIPTION_MATCH_ATTR_298=Specifies the name or OID of the \
  attribute whose value should exactly match the ID string provided to this \
  identity mapper.  At least one value must be provided.  All values must refer \
@@ -1549,36 +1382,12 @@
  group %s references target group %s which is itself a virtual static group. \
  One virtual static group is not allowed to reference another as its target \
  group
-INFO_FSCACHE_UPDATED_MAX_ENTRIES_477=The number of entries that may be held \
- in the entry cache has been updated to %d.  If this value has been reduced, \
- it may take some time for entries to be purged so that the cache can reflect \
- this new setting
-INFO_FSCACHE_UPDATED_LOCK_TIMEOUT_478=The lock timeout that will be used to \
- determine the length of time that the cache should block while attempting to \
- acquire a lock for an entry has been set to %d milliseconds
-INFO_FSCACHE_UPDATED_INCLUDE_FILTERS_479=The set of search filters that will \
- control which entries may be included in the cache has been updated
-INFO_FSCACHE_UPDATED_EXCLUDE_FILTERS_480=The set of search filters that will \
- control which entries should be be excluded from the cache has been updated
-INFO_FSCACHE_UPDATED_MAX_MEMORY_SIZE_481=The amount of space that may be used \
- for the entry cache has been updated to %d bytes. If the previous amount has \
- been reduced, it may take some time for entries to be purged so that the \
- current cache space consumption can reflect this new setting
-INFO_FSCACHE_UPDATED_TYPE_482=The entry cache type has been changed to %s
-INFO_FSCACHE_UPDATED_JE_MEMORY_PCT_483=The amount of memory that may be used \
- for the entry cache Berkeley DB JE internal cache has been updated to %d \
- percent of the total memory available to the JVM
-INFO_FSCACHE_UPDATED_JE_MEMORY_SIZE_484=The amount of JVM memory that may be \
- used for the entry cache Berkeley DB JE internal cache has been updated to %d \
- bytes
-INFO_FSCACHE_UPDATED_IS_PERSISTENT_485=The persistence state for the entry \
- cache has been changed to %s
-SEVERE_ERR_FSCACHE_CANNOT_LOAD_PERSISTENT_DATA_486=An error occurred while \
- trying to load persistent cache. Persistent cache will be flushed now
-SEVERE_ERR_FSCACHE_CANNOT_STORE_PERSISTENT_DATA_487=An error occurred while \
- trying to store persistent cache. Persistent cache will be flushed now
-FATAL_ERR_FSCACHE_CANNOT_INITIALIZE_488=A fatal error occurred while trying \
+FATAL_ERR_FSCACHE_CANNOT_INITIALIZE_486=A fatal error occurred while trying \
  to initialize file system entry cache:  %s
+SEVERE_ERR_FSCACHE_CANNOT_LOAD_PERSISTENT_DATA_487=An error occurred while \
+ trying to load persistent cache. Persistent cache will be flushed now
+SEVERE_ERR_FSCACHE_CANNOT_STORE_PERSISTENT_DATA_488=An error occurred while \
+ trying to store persistent cache. Persistent cache will be flushed now
 SEVERE_ERR_FSCACHE_CANNOT_STORE_ENTRY_489=Unable to store new cache entry in \
  the file system entry cache
 SEVERE_ERR_FSCACHE_CANNOT_RETRIEVE_ENTRY_490=Unable to retrieve an existing \
diff --git a/opendj-sdk/opends/src/server/org/opends/server/extensions/EntryCacheCommon.java b/opendj-sdk/opends/src/server/org/opends/server/extensions/EntryCacheCommon.java
index e7641c3..52ab40a 100644
--- a/opendj-sdk/opends/src/server/org/opends/server/extensions/EntryCacheCommon.java
+++ b/opendj-sdk/opends/src/server/org/opends/server/extensions/EntryCacheCommon.java
@@ -281,12 +281,8 @@
    *
    * @param filters  the list of string filter to convert to search filters
    * @param decodeErrorMsg  the error message ID to use in case of error
-   * @param errorHandler      an handler used to report errors
-   *                          during decoding of filter
-   * @param noFilterMsg     the error message ID to use when none of the
-   *                          filters was decoded properly
-   * @param configEntryDN     the DN of the configuration entry for the
-   *                          entry cache
+   * @param errorHandler  error handler to report filter decoding errors on
+   * @param configEntryDN  the entry cache configuration DN
    *
    * @return the set of search filters
    */
@@ -294,8 +290,6 @@
       SortedSet<String>       filters,
       MessageDescriptor.Arg3<CharSequence, CharSequence, CharSequence>
                               decodeErrorMsg,
-      MessageDescriptor.Arg1<CharSequence>
-                              noFilterMsg,
       ConfigErrorHandler      errorHandler,
       DN                      configEntryDN
       )
@@ -314,31 +308,12 @@
         }
         catch (DirectoryException de)
         {
-          // We couldn't decode this filter. Log a warning and continue.
-          errorHandler.reportError(
-                  decodeErrorMsg.get(
-                          String.valueOf(configEntryDN),
-                          curFilter,
-                          stackTraceToSingleLineString(de)),
-                  false,
-                  ResultCode.INVALID_ATTRIBUTE_SYNTAX
-          );
-        }
-      }
-
-      // If none of the filters was decoded properly log an error message
-      // (only if we are in initialize phase).
-      if ((errorHandler.getConfigPhase() == ConfigPhase.PHASE_INIT)
-          && searchFilters.isEmpty())
-      {
-        if (noFilterMsg != null) {
-          errorHandler.reportError(
-                  noFilterMsg.get(String.valueOf(configEntryDN)),
-                  false, null);
-        } else {
-          errorHandler.reportError( // TODO: i18n
-                  Message.raw("No filter provided: %s", configEntryDN),
-                  false, null);
+          // We couldn't decode this filter. Report an error and continue.
+          Message message = decodeErrorMsg.get(String.valueOf(configEntryDN),
+            curFilter, (de.getMessage() != null ? de.getMessage() :
+              stackTraceToSingleLineString(de)));
+          errorHandler.reportError(message, false,
+            ResultCode.INVALID_ATTRIBUTE_SYNTAX);
         }
       }
     }
diff --git a/opendj-sdk/opends/src/server/org/opends/server/extensions/FIFOEntryCache.java b/opendj-sdk/opends/src/server/org/opends/server/extensions/FIFOEntryCache.java
index dd9cd90..aff52ec 100644
--- a/opendj-sdk/opends/src/server/org/opends/server/extensions/FIFOEntryCache.java
+++ b/opendj-sdk/opends/src/server/org/opends/server/extensions/FIFOEntryCache.java
@@ -36,7 +36,6 @@
 import java.util.LinkedHashMap;
 import java.util.List;
 import java.util.Map;
-import java.util.Set;
 import java.util.concurrent.TimeUnit;
 import java.util.concurrent.locks.Lock;
 import java.util.concurrent.locks.ReentrantLock;
@@ -55,7 +54,6 @@
 import org.opends.server.types.DN;
 import org.opends.server.types.Entry;
 import org.opends.server.types.InitializationException;
-import org.opends.server.types.ResultCode;
 import org.opends.server.types.SearchFilter;
 import org.opends.server.util.ServerConstants;
 import org.opends.messages.MessageBuilder;
@@ -100,34 +98,15 @@
    */
   private static final DebugTracer TRACER = getTracer();
 
-
-
-  /**
-   * The set of time units that will be used for expressing the task retention
-   * time.
-   */
-  private static final LinkedHashMap<String,Double> timeUnits =
-       new LinkedHashMap<String,Double>();
-
-
-
   /**
    * The reference to the Java runtime used to determine the amount of memory
    * currently in use.
    */
   private static final Runtime runtime = Runtime.getRuntime();
 
-
-
-  // The DN of the configuration entry for this entry cache.
-  private DN configEntryDN;
-
   // The mapping between entry backends/IDs and entries.
   private HashMap<Backend,HashMap<Long,CacheEntry>> idMap;
 
-  // The maximum percentage of JVM memory that should be used by the cache.
-  private int maxMemoryPercent;
-
   // The mapping between DNs and entries.
   private LinkedHashMap<DN,CacheEntry> dnMap;
 
@@ -147,16 +126,6 @@
 
 
 
-  static
-  {
-    timeUnits.put(TIME_UNIT_MILLISECONDS_ABBR, 1D);
-    timeUnits.put(TIME_UNIT_MILLISECONDS_FULL, 1D);
-    timeUnits.put(TIME_UNIT_SECONDS_ABBR, 1000D);
-    timeUnits.put(TIME_UNIT_SECONDS_FULL, 1000D);
-  }
-
-
-
   /**
    * Creates a new instance of this FIFO entry cache.
    */
@@ -180,7 +149,6 @@
   {
     registeredConfiguration = configuration;
     configuration.addFIFOChangeListener (this);
-    configEntryDN = configuration.dn();
 
     // Initialize the cache structures.
     idMap     = new HashMap<Backend,HashMap<Long,CacheEntry>>();
@@ -949,80 +917,6 @@
 
 
   /**
-   * Makes a best-effort attempt to apply the configuration contained in the
-   * provided entry.  Information about the result of this processing should be
-   * added to the provided message list.  Information should always be added to
-   * this list if a configuration change could not be applied.  If detailed
-   * results are requested, then information about the changes applied
-   * successfully (and optionally about parameters that were not changed) should
-   * also be included.
-   *
-   * @param  configuration    The entry containing the new configuration to
-   *                          apply for this component.
-   * @param  detailedResults  Indicates whether detailed information about the
-   *                          processing should be added to the list.
-   *
-   * @return  Information about the result of the configuration update.
-   */
-  public ConfigChangeResult applyNewConfiguration(
-      FIFOEntryCacheCfg configuration,
-      boolean           detailedResults
-      )
-  {
-    // Store the current value to detect changes.
-    long              prevLockTimeout      = getLockTimeout();
-    long              prevMaxEntries       = maxEntries;
-    int               prevMaxMemoryPercent = maxMemoryPercent;
-    Set<SearchFilter> prevIncludeFilters   = getIncludeFilters();
-    Set<SearchFilter> prevExcludeFilters   = getExcludeFilters();
-
-    // Activate the new configuration.
-    ConfigChangeResult changeResult = applyConfigurationChange(configuration);
-
-    // Add detailed messages if needed.
-    ResultCode resultCode = changeResult.getResultCode();
-    boolean configIsAcceptable = (resultCode == ResultCode.SUCCESS);
-    if (detailedResults && configIsAcceptable)
-    {
-      if (maxMemoryPercent != prevMaxMemoryPercent)
-      {
-        changeResult.addMessage(
-            INFO_FIFOCACHE_UPDATED_MAX_MEMORY_PCT.get(maxMemoryPercent,
-                maxAllowedMemory));
-      }
-
-
-      if (maxEntries != prevMaxEntries)
-      {
-        changeResult.addMessage(
-            INFO_FIFOCACHE_UPDATED_MAX_ENTRIES.get(maxEntries));
-      }
-
-      if (getLockTimeout() != prevLockTimeout)
-      {
-        changeResult.addMessage(
-            INFO_FIFOCACHE_UPDATED_LOCK_TIMEOUT.get(getLockTimeout()));
-      }
-
-      if (!getIncludeFilters().equals(prevIncludeFilters))
-      {
-        changeResult.addMessage(
-            INFO_FIFOCACHE_UPDATED_INCLUDE_FILTERS.get());
-      }
-
-      if (!getExcludeFilters().equals(prevExcludeFilters))
-      {
-        changeResult.addMessage(
-            INFO_FIFOCACHE_UPDATED_EXCLUDE_FILTERS.get());
-      }
-    }
-
-    return changeResult;
-  }
-
-
-
-  /**
    * Parses the provided configuration and configure the entry cache.
    *
    * @param configuration  The new configuration containing the changes.
@@ -1061,34 +955,17 @@
     switch (errorHandler.getConfigPhase())
     {
     case PHASE_INIT:
+    case PHASE_ACCEPTABLE:
+    case PHASE_APPLY:
       newIncludeFilters = EntryCacheCommon.getFilters (
           configuration.getIncludeFilter(),
-          ERR_FIFOCACHE_INVALID_INCLUDE_FILTER,
-          WARN_FIFOCACHE_CANNOT_DECODE_ANY_INCLUDE_FILTERS,
+          ERR_CACHE_INVALID_INCLUDE_FILTER,
           errorHandler,
           newConfigEntryDN
           );
       newExcludeFilters = EntryCacheCommon.getFilters (
           configuration.getExcludeFilter(),
-          WARN_FIFOCACHE_CANNOT_DECODE_EXCLUDE_FILTER,
-          WARN_FIFOCACHE_CANNOT_DECODE_ANY_EXCLUDE_FILTERS,
-          errorHandler,
-          newConfigEntryDN
-          );
-      break;
-    case PHASE_ACCEPTABLE:  // acceptable and apply are using the same
-    case PHASE_APPLY:       // error ID codes
-      newIncludeFilters = EntryCacheCommon.getFilters (
-          configuration.getIncludeFilter(),
-          ERR_FIFOCACHE_INVALID_INCLUDE_FILTER,
-          null,
-          errorHandler,
-          newConfigEntryDN
-          );
-      newExcludeFilters = EntryCacheCommon.getFilters (
-          configuration.getExcludeFilter(),
-          ERR_FIFOCACHE_INVALID_EXCLUDE_FILTER,
-          null,
+          ERR_CACHE_INVALID_EXCLUDE_FILTER,
           errorHandler,
           newConfigEntryDN
           );
@@ -1097,9 +974,7 @@
 
     if (applyChanges && errorHandler.getIsAcceptable())
     {
-      configEntryDN    = newConfigEntryDN;
       maxEntries       = newMaxEntries;
-      maxMemoryPercent = newMaxMemoryPercent;
       maxAllowedMemory = newMaxAllowedMemory;
 
       setLockTimeout(newLockTimeout);
diff --git a/opendj-sdk/opends/src/server/org/opends/server/extensions/FileSystemEntryCache.java b/opendj-sdk/opends/src/server/org/opends/server/extensions/FileSystemEntryCache.java
index 3f92627..97442f3 100644
--- a/opendj-sdk/opends/src/server/org/opends/server/extensions/FileSystemEntryCache.java
+++ b/opendj-sdk/opends/src/server/org/opends/server/extensions/FileSystemEntryCache.java
@@ -129,26 +129,17 @@
   private static final FilePermission CACHE_HOME_PERMISSIONS =
       new FilePermission(0700);
 
-  // The DN of the configuration entry for this entry cache.
-  private DN configEntryDN;
-
   // The maximum amount of space in bytes that can be consumed in the filesystem
   // before we need to start purging entries.
   private long maxAllowedMemory;
 
   // The maximum number of entries that may be held in the cache.
-  // Atomic for additional safely and in case we decide to push
+  // Atomic for additional safety and in case we decide to push
   // some locks further down later. Does not inhere in additional
   // overhead, via blocking on synchronization primitive, on most
   // modern platforms being implemented via cpu instruction set.
   private AtomicLong maxEntries;
 
-  // The maximum percentage of memory dedicated to JE cache.
-  private int jeCachePercent;
-
-  // The maximum amount of memory in bytes dedicated to JE cache.
-  private long jeCacheSize;
-
   // The entry cache home folder to host db environment.
   private String cacheHome;
 
@@ -209,7 +200,7 @@
 
   // The configuration to use when encoding entries in the database.
   private EntryEncodeConfig encodeConfig =
-    new EntryEncodeConfig(true, false, false);
+    new EntryEncodeConfig(true, true, true);
 
   // JE native properties to configuration attributes map.
   private HashMap<String, String> configAttrMap =
@@ -242,7 +233,6 @@
 
     registeredConfiguration = configuration;
     configuration.addFileSystemChangeListener (this);
-    configEntryDN = configuration.dn();
 
     // Read and apply configuration.
     boolean applyChanges = true;
@@ -1064,98 +1054,6 @@
   }
 
   /**
-   * Makes a best-effort attempt to apply the configuration contained in the
-   * provided entry.  Information about the result of this processing should be
-   * added to the provided message list.  Information should always be added to
-   * this list if a configuration change could not be applied.  If detailed
-   * results are requested, then information about the changes applied
-   * successfully (and optionally about parameters that were not changed) should
-   * also be included.
-   *
-   * @param  configuration    The entry containing the new configuration to
-   *                          apply for this component.
-   * @param  detailedResults  Indicates whether detailed information about the
-   *                          processing should be added to the list.
-   *
-   * @return  Information about the result of the configuration update.
-   */
-  public ConfigChangeResult applyNewConfiguration(
-      FileSystemEntryCacheCfg configuration,
-      boolean           detailedResults
-      )
-  {
-    // Store the current value to detect changes.
-    long                  prevLockTimeout      = getLockTimeout();
-    long                  prevMaxEntries       = maxEntries.longValue();
-    Set<SearchFilter>     prevIncludeFilters   = getIncludeFilters();
-    Set<SearchFilter>     prevExcludeFilters   = getExcludeFilters();
-    long                  prevMaxAllowedMemory = maxAllowedMemory;
-    int                   prevJECachePercent   = jeCachePercent;
-    long                  prevJECacheSize      = jeCacheSize;
-    boolean               prevPersistentCache  = persistentCache;
-
-    // Activate the new configuration.
-    ConfigChangeResult changeResult = applyConfigurationChange(configuration);
-
-    // Add detailed messages if needed.
-    ResultCode resultCode = changeResult.getResultCode();
-    boolean configIsAcceptable = (resultCode == ResultCode.SUCCESS);
-    if (detailedResults && configIsAcceptable)
-    {
-      if (maxEntries.longValue() != prevMaxEntries)
-      {
-        changeResult.addMessage(
-            INFO_FSCACHE_UPDATED_MAX_ENTRIES.get(maxEntries));
-      }
-
-      if (getLockTimeout() != prevLockTimeout)
-      {
-        changeResult.addMessage(
-            INFO_FSCACHE_UPDATED_LOCK_TIMEOUT.get(getLockTimeout()));
-      }
-
-      if (!getIncludeFilters().equals(prevIncludeFilters))
-      {
-        changeResult.addMessage(
-            INFO_FSCACHE_UPDATED_INCLUDE_FILTERS.get());
-      }
-
-      if (!getExcludeFilters().equals(prevExcludeFilters))
-      {
-        changeResult.addMessage(
-            INFO_FSCACHE_UPDATED_EXCLUDE_FILTERS.get());
-      }
-
-      if (maxAllowedMemory != prevMaxAllowedMemory)
-      {
-        changeResult.addMessage(
-            INFO_FSCACHE_UPDATED_MAX_MEMORY_SIZE.get(maxAllowedMemory));
-      }
-
-      if (jeCachePercent != prevJECachePercent)
-      {
-        changeResult.addMessage(
-            INFO_FSCACHE_UPDATED_JE_MEMORY_PCT.get(jeCachePercent));
-      }
-
-      if (jeCacheSize != prevJECacheSize)
-      {
-        changeResult.addMessage(
-            INFO_FSCACHE_UPDATED_JE_MEMORY_SIZE.get(jeCacheSize));
-      }
-
-      if (persistentCache != prevPersistentCache)
-      {
-        changeResult.addMessage(
-            INFO_FSCACHE_UPDATED_IS_PERSISTENT.get(
-                    String.valueOf(persistentCache)));
-      }
-    }
-
-    return changeResult;
-  }
-
-  /**
    * Parses the provided configuration and configure the entry cache.
    *
    * @param configuration  The new configuration containing the changes.
@@ -1231,17 +1129,15 @@
 
       newIncludeFilters = EntryCacheCommon.getFilters(
           configuration.getIncludeFilter(),
-          ERR_FIFOCACHE_INVALID_INCLUDE_FILTER,
-          WARN_FIFOCACHE_CANNOT_DECODE_ANY_INCLUDE_FILTERS,
+          ERR_CACHE_INVALID_INCLUDE_FILTER,
           errorHandler,
-          configEntryDN
+          newConfigEntryDN
           );
       newExcludeFilters = EntryCacheCommon.getFilters (
           configuration.getExcludeFilter(),
-          WARN_FIFOCACHE_CANNOT_DECODE_EXCLUDE_FILTER,
-          WARN_FIFOCACHE_CANNOT_DECODE_ANY_EXCLUDE_FILTERS,
+          ERR_CACHE_INVALID_EXCLUDE_FILTER,
           errorHandler,
-          configEntryDN
+          newConfigEntryDN
           );
       // JE configuration properties.
       try {
@@ -1287,17 +1183,15 @@
     case PHASE_APPLY:       // error ID codes
       newIncludeFilters = EntryCacheCommon.getFilters (
           configuration.getIncludeFilter(),
-          ERR_FIFOCACHE_INVALID_INCLUDE_FILTER,
-          null,
+          ERR_CACHE_INVALID_INCLUDE_FILTER,
           errorHandler,
-          configEntryDN
+          newConfigEntryDN
           );
       newExcludeFilters = EntryCacheCommon.getFilters (
           configuration.getExcludeFilter(),
-          ERR_FIFOCACHE_INVALID_EXCLUDE_FILTER,
-          null,
+          ERR_CACHE_INVALID_EXCLUDE_FILTER,
           errorHandler,
-          configEntryDN
+          newConfigEntryDN
           );
       // Iterate through native JE properties.
       try {
@@ -1414,7 +1308,6 @@
         break;
       }
 
-      configEntryDN    = newConfigEntryDN;
       maxEntries       = new AtomicLong(newMaxEntries);
       maxAllowedMemory = newMaxAllowedMemory;
       persistentCache  = newPersistentCache;
diff --git a/opendj-sdk/opends/src/server/org/opends/server/extensions/SoftReferenceEntryCache.java b/opendj-sdk/opends/src/server/org/opends/server/extensions/SoftReferenceEntryCache.java
index d517506..ae8e5ba 100644
--- a/opendj-sdk/opends/src/server/org/opends/server/extensions/SoftReferenceEntryCache.java
+++ b/opendj-sdk/opends/src/server/org/opends/server/extensions/SoftReferenceEntryCache.java
@@ -34,7 +34,6 @@
 import java.util.ArrayList;
 import java.util.HashSet;
 import java.util.Iterator;
-import java.util.LinkedHashMap;
 import java.util.List;
 import java.util.concurrent.ConcurrentHashMap;
 import org.opends.messages.MessageBuilder;
@@ -80,13 +79,6 @@
    */
   private static final DebugTracer TRACER = getTracer();
 
-
-
-  // The set of time units that will be used for expressing the task retention
-  // time.
-  private static final LinkedHashMap<String,Double> timeUnits =
-       new LinkedHashMap<String,Double>();
-
   // The mapping between entry DNs and their corresponding entries.
   private ConcurrentHashMap<DN,SoftReference<CacheEntry>> dnMap;
 
@@ -94,9 +86,6 @@
   private ConcurrentHashMap<Backend,
                ConcurrentHashMap<Long,SoftReference<CacheEntry>>> idMap;
 
-  // The DN of the configuration entry for this entry cache implementation.
-  private DN configEntryDN;
-
   // The reference queue that will be used to notify us whenever a soft
   // reference is freed.
   private ReferenceQueue<CacheEntry> referenceQueue;
@@ -110,16 +99,6 @@
 
 
 
-  static
-  {
-    timeUnits.put(TIME_UNIT_MILLISECONDS_ABBR, 1D);
-    timeUnits.put(TIME_UNIT_MILLISECONDS_FULL, 1D);
-    timeUnits.put(TIME_UNIT_SECONDS_ABBR, 1000D);
-    timeUnits.put(TIME_UNIT_SECONDS_FULL, 1000D);
-  }
-
-
-
   /**
    * Creates a new instance of this soft reference entry cache.  All
    * initialization should be performed in the <CODE>initializeEntryCache</CODE>
@@ -156,7 +135,6 @@
   {
     registeredConfiguration = configuration;
     configuration.addSoftReferenceChangeListener (this);
-    configEntryDN = configuration.dn();
 
     dnMap.clear();
     idMap.clear();
@@ -580,34 +558,17 @@
     switch (errorHandler.getConfigPhase())
     {
     case PHASE_INIT:
+    case PHASE_ACCEPTABLE:
+    case PHASE_APPLY:
       newIncludeFilters = EntryCacheCommon.getFilters (
           configuration.getIncludeFilter(),
-          ERR_SOFTREFCACHE_INVALID_INCLUDE_FILTER,
-          WARN_SOFTREFCACHE_CANNOT_DECODE_ANY_INCLUDE_FILTERS,
+          ERR_CACHE_INVALID_INCLUDE_FILTER,
           errorHandler,
           newConfigEntryDN
           );
       newExcludeFilters = EntryCacheCommon.getFilters (
           configuration.getExcludeFilter(),
-          WARN_SOFTREFCACHE_CANNOT_DECODE_EXCLUDE_FILTER,
-          WARN_SOFTREFCACHE_CANNOT_DECODE_ANY_EXCLUDE_FILTERS,
-          errorHandler,
-          newConfigEntryDN
-          );
-      break;
-    case PHASE_ACCEPTABLE:  // acceptable and apply are using the same
-    case PHASE_APPLY:       // error ID codes
-      newIncludeFilters = EntryCacheCommon.getFilters (
-          configuration.getIncludeFilter(),
-          ERR_SOFTREFCACHE_INVALID_INCLUDE_FILTER,
-          null,
-          errorHandler,
-          newConfigEntryDN
-          );
-      newExcludeFilters = EntryCacheCommon.getFilters (
-          configuration.getExcludeFilter(),
-          ERR_SOFTREFCACHE_INVALID_EXCLUDE_FILTER,
-          null,
+          ERR_CACHE_INVALID_EXCLUDE_FILTER,
           errorHandler,
           newConfigEntryDN
           );
@@ -616,8 +577,6 @@
 
     if (applyChanges && errorHandler.getIsAcceptable())
     {
-      configEntryDN = newConfigEntryDN;
-
       setLockTimeout(newLockTimeout);
       setIncludeFilters(newIncludeFilters);
       setExcludeFilters(newExcludeFilters);

--
Gitblit v1.10.0