Interface CacheSettingsManager

  • All Superinterfaces:
    com.atlassian.cache.CacheSettingsDefaultsProvider
    All Known Implementing Classes:
    CachingCacheSettingsManager, DefaultCacheSettingsManager, PropertiesFileCacheSettingsManager

    public interface CacheSettingsManager
    extends com.atlassian.cache.CacheSettingsDefaultsProvider
    A manager for cache settings, provides operations for retrieving, runtime update and saving settings to persistent storage.

    At the moment only updating of max entries is supported.

    Runtime update is done via calling updateMaxEntries and changes become instantly visible to obtainDefaults.

    Persistence is done via calling saveSettings and it stores changes made by all previous calls to update* methods.

    • Method Detail

      • updateMaxEntries

        @Deprecated
        com.atlassian.fugue.Option<Integer> updateMaxEntries​(@NonNull String name,
                                                             int newValue)
        Deprecated.
        Persists updates to the max entries settings for the specified cache.

        Parameters:
        name - the name of the cache to update
        Returns:
        the previous value of the specified max entries if any have
      • changeMaxEntries

        default Optional<Integer> changeMaxEntries​(@NonNull String name,
                                                   int newValue)
        Persists updates to the max entries settings for the specified cache.

        Parameters:
        name - the name of the cache to update
        Returns:
        the previous value of the specified max entries if any have
        Since:
        7.0.1
      • saveSettings

        boolean saveSettings()
        Persists all changes made so far by update* methods.

        Returns:
        true if changes were persisted successfully