Package com.atlassian.bamboo.persister
Class CachedBuildPersisterDecorator
- java.lang.Object
-
- com.atlassian.bamboo.persister.CachedBuildPersisterDecorator
-
- All Implemented Interfaces:
Startable
,BuildPersisterDecorator
public class CachedBuildPersisterDecorator extends Object implements BuildPersisterDecorator
Caches the builds so speed up performance and handle transient Build fields.
-
-
Constructor Summary
Constructors Constructor Description CachedBuildPersisterDecorator(BuildPersisterDecorator parent)
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description void
deleteBuildResults(PlanKey planKey, long buildNumber)
Remove a specific build buildboolean
isActive()
Indicates whether this is currently active.@Nullable BuildResults
loadBuildResults(Key planKey, int buildNumber)
Cache the build results so that the least used results get purgedvoid
saveBuildResults(PlanKey planKey, BuildResults buildResults)
Simply pass this request onto the parentvoid
start()
Loads the cache from the parent decorator on startup;void
stop()
Stop the component and clean up any resources
-
-
-
Constructor Detail
-
CachedBuildPersisterDecorator
public CachedBuildPersisterDecorator(BuildPersisterDecorator parent)
-
-
Method Detail
-
start
public void start() throws Exception
Loads the cache from the parent decorator on startup;
-
stop
public void stop() throws Exception
Description copied from interface:Startable
Stop the component and clean up any resources
-
isActive
public boolean isActive()
Description copied from interface:Startable
Indicates whether this is currently active.
-
deleteBuildResults
public void deleteBuildResults(PlanKey planKey, long buildNumber) throws PersisterException
Remove a specific build build- Specified by:
deleteBuildResults
in interfaceBuildPersisterDecorator
- Parameters:
planKey
-buildNumber
- The build number- Throws:
PersisterException
-
saveBuildResults
public void saveBuildResults(PlanKey planKey, BuildResults buildResults) throws PersisterException
Simply pass this request onto the parent- Specified by:
saveBuildResults
in interfaceBuildPersisterDecorator
buildResults
- The build results to persist- Throws:
PersisterException
- when failed to persist the build results
-
loadBuildResults
@Nullable public @Nullable BuildResults loadBuildResults(Key planKey, int buildNumber) throws PersisterException
Cache the build results so that the least used results get purged- Specified by:
loadBuildResults
in interfaceBuildPersisterDecorator
buildNumber
- The number of the build results we are interested in- Returns:
- The buildResults
- Throws:
PersisterException
- when failed to load the build results
-
-