Package io.higson.runtime.core.domain
Class MpDomainCacheManager
java.lang.Object
io.higson.runtime.core.domain.AbstractDomainCacheManager
io.higson.runtime.core.domain.MpDomainCacheManager
- All Implemented Interfaces:
DomainCacheManager,WatcherDomainCacheManager
public class MpDomainCacheManager
extends AbstractDomainCacheManager
implements WatcherDomainCacheManager
-
Field Summary
Fields inherited from class io.higson.runtime.core.domain.AbstractDomainCacheManager
cacheProvider, headElementsByProfiles, refreshController, sessionElementsByCacheKey -
Constructor Summary
ConstructorsConstructorDescriptionMpDomainCacheManager(MpDomainCacheProvider cacheProvider, EffectiveVersionResolver effectiveVersionResolver, MpDomainRefreshController refreshController) -
Method Summary
Modifier and TypeMethodDescriptionvoiddoWatch()Set of profiles (head + session), which have at least one domain element.getByPath(String profileCode, String path, EffectiveVersionConfiguration configuration) Returns domain object from given domain's path.getPossibleModification(Map<String, Date> lastUpdatesByProfile) Set of profiles (only HEAD), which have at least one domain element.getSessionElementByPath(String profileCode, String user, String path, EffectiveVersionConfiguration configuration) Returns domain object from given domain's path.voidinvalidateProfile(String profile) Invalidate entries associated with given profile.voidinvalidateTreeVersionCachesAfter(int invalidateValue, TemporalUnit unit) Invalidate domain tree from cache if it's build time exceeds provided combination of given invalidateValue and unit.protected voidrefreshHeads(String profileCode, EffectiveVersionConfiguration configuration) voidrefreshProfile(String profileCode) Reload caches.voidupdateProfileController(String profile, Map<String, Date> lastUpdatesByProfile) booleanChecks, whenever something was changed for any of existing profiles.Methods inherited from class io.higson.runtime.core.domain.AbstractDomainCacheManager
containsProfileCode, getByPath, getSessionElementByPath, invalidateAllCaches, refreshHeads, refreshSessionsOfProfileAndUserMethods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, waitMethods inherited from interface io.higson.runtime.core.domain.DomainCacheManager
getByPath, getSessionElementByPath, invalidateAllCaches, isValid
-
Constructor Details
-
MpDomainCacheManager
public MpDomainCacheManager(MpDomainCacheProvider cacheProvider, EffectiveVersionResolver effectiveVersionResolver, MpDomainRefreshController refreshController)
-
-
Method Details
-
getProfiles
Description copied from class:AbstractDomainCacheManagerSet of profiles (only HEAD), which have at least one domain element.- Specified by:
getProfilesin interfaceDomainCacheManager- Overrides:
getProfilesin classAbstractDomainCacheManager- Returns:
- set of profiles codes
-
getAllProfiles
Description copied from class:AbstractDomainCacheManagerSet of profiles (head + session), which have at least one domain element.- Specified by:
getAllProfilesin interfaceDomainCacheManager- Overrides:
getAllProfilesin classAbstractDomainCacheManager- Returns:
- set of profiles codes
-
getByPath
public DomainObject getByPath(String profileCode, String path, EffectiveVersionConfiguration configuration) Description copied from interface:DomainCacheManagerReturns domain object from given domain's path. Domain is created only from head elements, session changes are not visible. If you want to get domain element with session changes. useDomainCacheManager.getSessionElementByPath(String, String, String, EffectiveVersionConfiguration)- Specified by:
getByPathin interfaceDomainCacheManager- Overrides:
getByPathin classAbstractDomainCacheManager- Parameters:
profileCode- profile code to fetch its domainpath- domain's path, i.e./PLANS[LIAB]/OPTIONS[OPT1]configuration- configuration to override specific version or date. Active system versions will be used if not present- Returns:
- found domain object or null, if object does not exist
- See Also:
-
refreshHeads
- Specified by:
refreshHeadsin classAbstractDomainCacheManager
-
getSessionElementByPath
public DomainObject getSessionElementByPath(String profileCode, String user, String path, EffectiveVersionConfiguration configuration) Description copied from interface:DomainCacheManagerReturns domain object from given domain's path. Domain is created from head elements + elements from user's session- Specified by:
getSessionElementByPathin interfaceDomainCacheManager- Parameters:
profileCode- profile code to fetch its domainuser- user nickname to get specific sessionpath- domain's path, i.e./PLANS[LIAB]/OPTIONS[OPT1]configuration- configuration to override specific version or date. Active system versions will be used if not present- Returns:
- found domain object or null, if object does not exist
- See Also:
-
refreshProfile
Reload caches.- Specified by:
refreshProfilein interfaceWatcherDomainCacheManager- Parameters:
profileCode- profile code
-
wasSomethingChange
public boolean wasSomethingChange()Description copied from interface:DomainCacheManagerChecks, whenever something was changed for any of existing profiles. If there are no profiles, this should return false. Otherwise there are checks for elements like regions, version, domain elements configuration or definition.- Specified by:
wasSomethingChangein interfaceDomainCacheManager- Returns:
- true if something was changed during last update, or false
-
getLastUpdatesByProfile
- Specified by:
getLastUpdatesByProfilein interfaceWatcherDomainCacheManager
-
getPossibleModification
- Specified by:
getPossibleModificationin interfaceWatcherDomainCacheManager
-
updateProfileController
- Specified by:
updateProfileControllerin interfaceWatcherDomainCacheManager
-
doWatch
public void doWatch()- Specified by:
doWatchin interfaceWatcherDomainCacheManager
-
invalidateTreeVersionCachesAfter
Description copied from interface:DomainCacheManagerInvalidate domain tree from cache if it's build time exceeds provided combination of given invalidateValue and unit. If not provided, defaultDomainWatcherConfig.DEFAULT_LIFESPAN_IN_CACHE_VALUEandDomainWatcherConfig.DEFAULT_LIFESPAN_IN_CACHE_UNITlifespan will be used.- Specified by:
invalidateTreeVersionCachesAfterin interfaceDomainCacheManager- Parameters:
invalidateValue- value of domain tree lifespan in cacheunit- of lifespan
-
invalidateProfile
Description copied from interface:DomainCacheManagerInvalidate entries associated with given profile.- Specified by:
invalidateProfilein interfaceDomainCacheManager
-