Class IpRangeCache

java.lang.Object
io.goobi.viewer.model.security.user.IpRangeCache

public class IpRangeCache extends Object

Application-scoped cache for IpRange reads. See docs/superpowers/specs/2026-04-22-dao-access-cache-design.md.

Thread-safety and invalidation contract match io.goobi.viewer.model.security.LicenseTypeCache.

Staleness note on IpRange.licenses: the hydrated licenses collection on each cached IpRange can become stale after addLicense / updateLicense / deleteLicense writes (those writes do not invalidate this cache, because the relevant access-decision code paths go through the DAO for getLicenses(...) directly). Do not rely on cachedIpRange.getLicenses() for authorisation decisions.

  • Constructor Details

    • IpRangeCache

      public IpRangeCache()
  • Method Details

    • getAllIpRanges

      public List<IpRange> getAllIpRanges() throws DAOException
      Returns all IpRanges as an immutable list.
      Returns:
      immutable list of IP ranges; never null
      Throws:
      DAOException - if the underlying DAO load fails
    • invalidate

      public void invalidate()
      Drops the current snapshot. The next read reloads from the DAO. Called by JPADAO write methods after a successful commit.