public class ImmutablePlanCacheServiceImpl extends Object implements ImmutablePlanCacheService
ImmutablePlanCacheService.CacheInvalidator
Constructor and Description |
---|
ImmutablePlanCacheServiceImpl(ImmutablePlanManager immutablePlanManager,
PlanDao planDao,
org.springframework.transaction.support.TransactionTemplate transactionTemplate,
com.atlassian.config.db.HibernateConfig hibernateConfig,
org.springframework.orm.hibernate3.HibernateTemplate hibernateTemplate,
CustomVariableContext customVariableContext,
BuildResultsSummaryDao buildResultsSummaryDao) |
Modifier and Type | Method and Description |
---|---|
void |
cascadeInvalidate(long chainId)
Removes the cached reference for the passed plan and its children.
|
void |
cascadeInvalidate(PlanKey planKey)
Removes the cached reference for the passed plan and its children.
|
protected org.springframework.transaction.support.TransactionTemplate |
createTransactionTemplate(org.springframework.transaction.support.TransactionTemplate transactionTemplate) |
void |
disableCache()
Disable cache.
|
void |
enableCache()
Enable cache.
|
Range<Integer> |
getBuildNumbersRange(PlanKey planKey)
internal use only.
|
BambooCacheStats |
getCacheStats()
Retrieve cache statistics
|
Iterable<PlanKey> |
getChainsToInvalidate(ImmutablePlanCacheService.CacheInvalidator invalidator)
Internal.
|
ImmutableChain |
getImmutablePlanByKey(PlanKey planKey)
Returns a plan if one exists with the key.
|
PlanCacheIndices |
getIndices()
Returns the indices created for plan cache content.
|
ReentrantReadWriteLock |
getLock(PlanKey planKey)
Makes plan inaccessible
|
Integer |
getNextBuildNumberOverride(PlanKey planKey)
internal use only.
|
PlanIdentifier |
getPlanIdentifierForPermissionCheckingByKey(PlanKey planKey) |
<T extends ImmutablePlan> |
getPlans(Class<T> planType)
|
<T extends ImmutablePlan> |
getPlans(Class<T> planType,
com.google.common.base.Predicate<? super T> filter)
|
void |
initialiseCache()
Clear the cache and attempt to read all Chains from DB in order to cache them.
|
void |
invalidate(PlanKey planKey)
Removes the cached Plan.
|
void |
invalidateBuildNumbersRange(PlanKey planKey,
int buildNumber,
boolean trueForSaveFalseForDelete)
internal use only.
|
void |
reset(PlanKey planKey)
Removes the cached Plan and its metadata.
|
void |
resetAll()
Nukes the cache
|
void |
setNextBuildNumberOverride(PlanKey planKey,
int nextBuildNumber)
internal use only.
|
public ImmutablePlanCacheServiceImpl(@NotNull ImmutablePlanManager immutablePlanManager, @NotNull PlanDao planDao, @NotNull org.springframework.transaction.support.TransactionTemplate transactionTemplate, @NotNull com.atlassian.config.db.HibernateConfig hibernateConfig, @NotNull org.springframework.orm.hibernate3.HibernateTemplate hibernateTemplate, @NotNull CustomVariableContext customVariableContext, @NotNull BuildResultsSummaryDao buildResultsSummaryDao)
protected org.springframework.transaction.support.TransactionTemplate createTransactionTemplate(org.springframework.transaction.support.TransactionTemplate transactionTemplate)
@Nullable public ImmutableChain getImmutablePlanByKey(@NotNull PlanKey planKey)
ImmutablePlanCacheService
getImmutablePlanByKey
in interface ImmutablePlanCacheService
public void invalidate(@NotNull PlanKey planKey)
ImmutablePlanCacheService
invalidate
in interface ImmutablePlanCacheService
planKey
- key of the Plan to be removed from cachepublic void cascadeInvalidate(@NotNull PlanKey planKey)
ImmutablePlanCacheService
cascadeInvalidate
in interface ImmutablePlanCacheService
planKey
- key of the Plan to be removed from cache@NotNull public Iterable<PlanKey> getChainsToInvalidate(@NotNull ImmutablePlanCacheService.CacheInvalidator invalidator)
ImmutablePlanCacheService
ImmutablePlanCacheService.CacheInvalidator
getChainsToInvalidate
in interface ImmutablePlanCacheService
public void cascadeInvalidate(long chainId)
ImmutablePlanCacheService
cascadeInvalidate
in interface ImmutablePlanCacheService
chainId
- id of chain to be removed from cachepublic void reset(@NotNull PlanKey planKey)
ImmutablePlanCacheService
reset
in interface ImmutablePlanCacheService
planKey
- key of the Plan to be removed from cachepublic void resetAll()
ImmutablePlanCacheService
resetAll
in interface ImmutablePlanCacheService
public void initialiseCache()
ImmutablePlanCacheService
initialiseCache
in interface ImmutablePlanCacheService
public void disableCache()
ImmutablePlanCacheService
disableCache
in interface ImmutablePlanCacheService
public void enableCache()
ImmutablePlanCacheService
ImmutablePlanCacheService.initialiseCache()
instead if you expect plans to be loaded.enableCache
in interface ImmutablePlanCacheService
public BambooCacheStats getCacheStats()
ImmutablePlanCacheService
getCacheStats
in interface ImmutablePlanCacheService
@NotNull public PlanCacheIndices getIndices()
ImmutablePlanCacheService
getIndices
in interface ImmutablePlanCacheService
@NotNull public <T extends ImmutablePlan> List<T> getPlans(Class<T> planType)
ImmutablePlanCacheService
getPlans
in interface ImmutablePlanCacheService
planType
- - the type of the plan to retrieveDescriptionProvider.getName()
@NotNull public <T extends ImmutablePlan> List<T> getPlans(Class<T> planType, @NotNull com.google.common.base.Predicate<? super T> filter)
ImmutablePlanCacheService
getPlans
in interface ImmutablePlanCacheService
planType
- - the type of the plan to retrieveDescriptionProvider.getName()
public PlanIdentifier getPlanIdentifierForPermissionCheckingByKey(@NotNull PlanKey planKey)
getPlanIdentifierForPermissionCheckingByKey
in interface ImmutablePlanCacheService
public ReentrantReadWriteLock getLock(@NotNull PlanKey planKey)
ImmutablePlanCacheService
getLock
in interface ImmutablePlanCacheService
planKey
- key of the Plan to be made inaccessiblepublic void setNextBuildNumberOverride(PlanKey planKey, int nextBuildNumber)
ImmutablePlanCacheService
setNextBuildNumberOverride
in interface ImmutablePlanCacheService
@Nullable public Integer getNextBuildNumberOverride(PlanKey planKey)
ImmutablePlanCacheService
getNextBuildNumberOverride
in interface ImmutablePlanCacheService
@NotNull public Range<Integer> getBuildNumbersRange(PlanKey planKey)
ImmutablePlanCacheService
getBuildNumbersRange
in interface ImmutablePlanCacheService
public void invalidateBuildNumbersRange(PlanKey planKey, int buildNumber, boolean trueForSaveFalseForDelete)
ImmutablePlanCacheService
invalidateBuildNumbersRange
in interface ImmutablePlanCacheService
Copyright © 2016 Atlassian Software Systems Pty Ltd. All rights reserved.