Class ProgramCachedStorage
java.lang.Object
io.meeds.gamification.storage.ProgramStorage
io.meeds.gamification.storage.cached.ProgramCachedStorage
-
Nested Class Summary
Nested ClassesModifier and TypeClassDescriptionclassclassclass -
Field Summary
FieldsModifier and TypeFieldDescriptionstatic final StringThe cache of the rewarding administrators, which a cluster invalidates on every node when one of them changesstatic final StringFields inherited from class ProgramStorage
organizationService -
Constructor Summary
ConstructorsConstructorDescriptionProgramCachedStorage(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 Summary
Modifier and TypeMethodDescriptionvoidRemoves the rewarding administrators from the cache, on every node of a cluster: the next read loads them again.voidvoidvoiddeleteImage(long fileId) getProgramById(Long id) saveProgram(ProgramDTO program) voidupdateProgramDate(long programId) Methods inherited from class ProgramStorage
countPrograms, findHighestBudgetProgramIdsBySpacesIds, getImageAsStream, getProgramByTitle, getProgramIdsByFilter, isProgramColorExists
-
Field Details
-
PROGRAM_CACHE_NAME
- See Also:
-
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
- Overrides:
saveProgramin classProgramStorage
-
updateProgramDate
public void updateProgramDate(long programId) - Overrides:
updateProgramDatein classProgramStorage
-
getProgramById
- Overrides:
getProgramByIdin classProgramStorage
-
deleteImage
public void deleteImage(long fileId) - Overrides:
deleteImagein classProgramStorage
-
getAdministrators
- Overrides:
getAdministratorsin classProgramStorage
-
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:
clearCachein classProgramStorage
-
getAdministratorsConcurrently
-
clearRulesListCache
public void clearRulesListCache()
-