Class QueueManagerView<S extends CommonContext,V>
java.lang.Object
com.atlassian.bamboo.v2.build.queue.QueueManagerView<S,V>
QueueManagerView is the only class that should be used to access Bamboo queue. The idea behind it is that the client code will store a subset of
data from the build queue a 'queue view' and every time it needs new data, it will supply the previous view. In this way, the amount of
data stored in memory will be reduced - Bamboo will no longer have to keep all data of all builds in memory.
To use it, instantiate a view via
newBuildView(BuildQueueManager, Function)
or newBuildView(BuildQueueManager, Function)
,
store the reference and use getQueueView(Iterable)
to get the data you need. Store the view reference for later use (you probably want to use a volatile
variable for it.-
Method Summary
Modifier and TypeMethodDescriptiongetQueueView
(Iterable<BuildQueueManager.QueueItemView<V>> previouslyQueuedExecutables) static <V> QueueManagerView<BuildContext,
V> newBuildView
(BuildQueueManager buildQueueManager, Function<BuildQueueManager.QueueItemView<BuildContext>, BuildQueueManager.QueueItemView<V>> viewMapper) Convenience method that returns a view with builds (not deployments).static <V> QueueManagerView<CommonContext,
V> newView
(BuildQueueManager buildQueueManager, Function<BuildQueueManager.QueueItemView<CommonContext>, BuildQueueManager.QueueItemView<V>> context2QueueItem) Creates a queue view that returns all queued executables - without filtering
-
Method Details
-
newBuildView
public static <V> QueueManagerView<BuildContext,V> newBuildView(BuildQueueManager buildQueueManager, Function<BuildQueueManager.QueueItemView<BuildContext>, BuildQueueManager.QueueItemView<V>> viewMapper) Convenience method that returns a view with builds (not deployments). -
newView
public static <V> QueueManagerView<CommonContext,V> newView(BuildQueueManager buildQueueManager, Function<BuildQueueManager.QueueItemView<CommonContext>, BuildQueueManager.QueueItemView<V>> context2QueueItem) Creates a queue view that returns all queued executables - without filtering -
getQueueView
public Iterable<BuildQueueManager.QueueItemView<V>> getQueueView(Iterable<BuildQueueManager.QueueItemView<V>> previouslyQueuedExecutables)
-