Class CachedProfileSettingStorage

java.lang.Object
org.exoplatform.social.core.profileproperty.storage.ProfileSettingStorage
io.meeds.social.core.profileproperty.storage.CachedProfileSettingStorage

public class CachedProfileSettingStorage extends ProfileSettingStorage
Caches the settings by id, their ids by name and their ordered id list. A write invalidates every key it changes: the setting's id, its old and new parents' ids, its old and new names and the id list. Each key is read through its cache before the write, so that this node holds it and its eviction is published to the other nodes of a cluster, then evicted after the write, and again once the transaction completes, when one is active.
  • Field Details

  • Constructor Details

  • Method Details

    • getPropertySettings

      public List<org.exoplatform.social.core.profileproperty.model.ProfilePropertySetting> getPropertySettings()
      Overrides:
      getPropertySettings in class ProfileSettingStorage
    • findProfileSettingByName

      public org.exoplatform.social.core.profileproperty.model.ProfilePropertySetting findProfileSettingByName(String name)
      Overrides:
      findProfileSettingByName in class ProfileSettingStorage
    • getProfileSettingById

      public org.exoplatform.social.core.profileproperty.model.ProfilePropertySetting getProfileSettingById(Long id)
      Overrides:
      getProfileSettingById in class ProfileSettingStorage
    • saveProfilePropertySetting

      public org.exoplatform.social.core.profileproperty.model.ProfilePropertySetting saveProfilePropertySetting(org.exoplatform.social.core.profileproperty.model.ProfilePropertySetting profilePropertySetting, boolean isNew)
      Overrides:
      saveProfilePropertySetting in class ProfileSettingStorage
    • deleteProfilePropertySetting

      public void deleteProfilePropertySetting(Long id)
      Overrides:
      deleteProfilePropertySetting in class ProfileSettingStorage
    • clearListingFlags

      public boolean clearListingFlags(Long id)
      Description copied from class: ProfileSettingStorage
      Switches off both listing flags of a stored setting, in the caller's transaction.
      Overrides:
      clearListingFlags in class ProfileSettingStorage
      Parameters:
      id - the setting's technical identifier
      Returns:
      true when a flag was on and the setting was changed
    • clearCaches

      public void clearCaches()
      Clears this node's three caches and the loads in flight, with no eviction published to the other nodes.