Class ProgramCachedStorage

java.lang.Object
io.meeds.gamification.storage.ProgramStorage
io.meeds.gamification.storage.cached.ProgramCachedStorage

public class ProgramCachedStorage extends ProgramStorage
  • Field Details

    • PROGRAM_CACHE_NAME

      public static final String PROGRAM_CACHE_NAME
      See Also:
    • ADMINISTRATORS_CACHE_NAME

      public static final String ADMINISTRATORS_CACHE_NAME
      The cache of the rewarding administrators, which a cluster invalidates on every node when one of them changes
      See Also:
  • Constructor Details

    • ProgramCachedStorage

      public ProgramCachedStorage(org.exoplatform.commons.file.services.FileService fileService, org.exoplatform.upload.UploadService uploadService, ProgramDAO programDAO, RuleDAO ruleDAO, org.exoplatform.services.cache.CacheService cacheService, org.exoplatform.services.listener.ListenerService listenerService, org.exoplatform.services.organization.OrganizationService organizationService, org.exoplatform.container.PortalContainer container)
  • Method Details

    • saveProgram

      public ProgramDTO saveProgram(ProgramDTO program)
      Overrides:
      saveProgram in class ProgramStorage
    • updateProgramDate

      public void updateProgramDate(long programId)
      Overrides:
      updateProgramDate in class ProgramStorage
    • getProgramById

      public ProgramDTO getProgramById(Long id)
      Overrides:
      getProgramById in class ProgramStorage
    • deleteImage

      public void deleteImage(long fileId)
      Overrides:
      deleteImage in class ProgramStorage
    • getAdministrators

      public List<String> getAdministrators()
      Overrides:
      getAdministrators in class ProgramStorage
    • clearAdministrators

      public void clearAdministrators()
      Removes the rewarding administrators from the cache, on every node of a cluster: the next read loads them again. The membership listeners call it asynchronously, which can run before the membership change is committed, and it does not stop a load already running: either can cache the list read before the change, which is then kept until the entry expires, at most the cache's live time, 30 seconds by default. In this add-on the list feeds the programs' display (ProgramBuilder) only.
    • clearCache

      public void clearCache()
      Overrides:
      clearCache in class ProgramStorage
    • getAdministratorsConcurrently

      public List<String> getAdministratorsConcurrently()
    • clearRulesListCache

      public void clearRulesListCache()