|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object com.atlassian.bamboo.plan.cache.ImmutablePlanCacheServiceImpl
public class ImmutablePlanCacheServiceImpl
Nested Class Summary |
---|
Nested classes/interfaces inherited from interface com.atlassian.bamboo.plan.cache.ImmutablePlanCacheService |
---|
ImmutablePlanCacheService.CacheInvalidator |
Constructor Summary | |
---|---|
ImmutablePlanCacheServiceImpl(ImmutablePlanManager immutablePlanManager,
PlanDao planDao,
org.springframework.transaction.support.TransactionTemplate transactionTemplate,
org.springframework.orm.hibernate.HibernateTemplate hibernateTemplate)
|
Method Summary | ||
---|---|---|
void |
cascadeInvalidate(long chainId)
Resetting cache by id is evil and should not be done. |
|
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. |
|
java.util.List<ImmutableChainBranch> |
getBranchesForChain(PlanKey planKey)
Returns a list of branches for given chain |
|
int[] |
getBuildNumberOverrides(PlanKey planKey)
internal use only. |
|
BambooCacheStats |
getCacheStats()
Retrieve cache statistics |
|
java.lang.Iterable<PlanKey> |
getChainsToInvalidate(ImmutablePlanCacheService.CacheInvalidator invalidator)
Internal. |
|
ImmutableChain |
getImmutablePlanByKey(PlanKey planKey)
Returns a plan if one exists with the key. |
|
java.util.concurrent.locks.ReentrantReadWriteLock |
getLock(PlanKey planKey)
Makes plan inaccessible |
|
ImmutableJob |
getMasterOfJob(PlanKey jobKey,
PlanKey masterChainKey)
|
|
PlanIdentifier |
getPlanIdentifierForPermissionCheckingByKey(PlanKey planKey)
Returns a Plan skeleton skeleton providing ONLY id and key, that matches the given key This method should
be used only for permission checking using Acegi
If Job key is provided as a parameter, parent Chain will be returned anyway, as Acegi assertions are
defined only for TopLevelPlan s |
|
|
getPlans(java.lang.Class<T> planType)
Returns all Plan 's filtered by Class . |
|
|
getPlans(java.lang.Class<T> planType,
com.google.common.base.Predicate<? super T> filter)
Returns all Plan 's filtered by Class . |
|
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 |
reset(PlanKey planKey)
Removes the cached Plan and its metadata. |
|
void |
resetAll()
Nukes the cache |
|
void |
setBuildNumberOverrides(PlanKey planKey,
int firstBuildNumber,
int lastBuildNumber,
int nextBuildNumber)
internal use only. |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Constructor Detail |
---|
public ImmutablePlanCacheServiceImpl(@NotNull ImmutablePlanManager immutablePlanManager, @NotNull PlanDao planDao, @NotNull org.springframework.transaction.support.TransactionTemplate transactionTemplate, @NotNull org.springframework.orm.hibernate.HibernateTemplate hibernateTemplate)
Method Detail |
---|
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
@NotNull public java.util.List<ImmutableChainBranch> getBranchesForChain(@NotNull PlanKey planKey)
ImmutablePlanCacheService
getBranchesForChain
in interface ImmutablePlanCacheService
public ImmutableJob getMasterOfJob(@NotNull PlanKey jobKey, @NotNull PlanKey masterChainKey)
getMasterOfJob
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 java.lang.Iterable<PlanKey> getChainsToInvalidate(@NotNull ImmutablePlanCacheService.CacheInvalidator invalidator)
ImmutablePlanCacheService
ImmutablePlanCacheService.CacheInvalidator
getChainsToInvalidate
in interface ImmutablePlanCacheService
public void cascadeInvalidate(long chainId)
PlanConfigurationAspect.resetImmutablePlanCacheService(BranchCommitInformation)
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 <T extends ImmutablePlan> java.util.List<T> getPlans(java.lang.Class<T> planType)
ImmutablePlanCacheService
Plan
's filtered by Class
. Does not include plans marked for deletion.
This method will not load anything from DB - it will operate only on cached data.
getPlans
in interface ImmutablePlanCacheService
planType
- - the type of the plan to retrieve
DescriptionProvider.getName()
@NotNull public <T extends ImmutablePlan> java.util.List<T> getPlans(java.lang.Class<T> planType, @NotNull com.google.common.base.Predicate<? super T> filter)
ImmutablePlanCacheService
Plan
's filtered by Class
. Does not include plans marked for deletion.
This method will not load anything from DB - it will operate only on cached data.
getPlans
in interface ImmutablePlanCacheService
planType
- - the type of the plan to retrieve
DescriptionProvider.getName()
public PlanIdentifier getPlanIdentifierForPermissionCheckingByKey(@NotNull PlanKey planKey)
ImmutablePlanCacheService
Plan
skeleton skeleton providing ONLY id and key, that matches the given key This method should
be used only for permission checking using Acegi
If Job
key is provided as a parameter, parent Chain will be returned anyway, as Acegi assertions are
defined only for TopLevelPlan
s
getPlanIdentifierForPermissionCheckingByKey
in interface ImmutablePlanCacheService
planKey
- of the plan to find
public java.util.concurrent.locks.ReentrantReadWriteLock getLock(@NotNull PlanKey planKey)
ImmutablePlanCacheService
getLock
in interface ImmutablePlanCacheService
planKey
- key of the Plan to be made inaccessiblepublic void setBuildNumberOverrides(PlanKey planKey, int firstBuildNumber, int lastBuildNumber, int nextBuildNumber)
ImmutablePlanCacheService
setBuildNumberOverrides
in interface ImmutablePlanCacheService
@Nullable public int[] getBuildNumberOverrides(PlanKey planKey)
ImmutablePlanCacheService
getBuildNumberOverrides
in interface ImmutablePlanCacheService
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |