com.atlassian.bamboo.v2.build.queue
Class QueueManagerView<S extends CommonContext,V>

java.lang.Object
  extended by com.atlassian.bamboo.v2.build.queue.QueueManagerView<S,V>

public class QueueManagerView<S extends CommonContext,V>
extends java.lang.Object

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, com.google.common.base.Function) or newBuildView(BuildQueueManager, com.google.common.base.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
 java.lang.Iterable<BuildQueueManager.QueueItemView<V>> getQueueView(java.lang.Iterable<BuildQueueManager.QueueItemView<V>> previouslyQueuedExecutables)
           
static
<V> QueueManagerView<BuildContext,V>
newBuildView(BuildQueueManager buildQueueManager, com.google.common.base.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, com.google.common.base.Function<BuildQueueManager.QueueItemView<CommonContext>,BuildQueueManager.QueueItemView<V>> context2QueueItem)
          Creates a queue view that returns all queued executables - without filtering
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Method Detail

newBuildView

public static <V> QueueManagerView<BuildContext,V> newBuildView(BuildQueueManager buildQueueManager,
                                                                com.google.common.base.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,
                                                            com.google.common.base.Function<BuildQueueManager.QueueItemView<CommonContext>,BuildQueueManager.QueueItemView<V>> context2QueueItem)
Creates a queue view that returns all queued executables - without filtering


getQueueView

public java.lang.Iterable<BuildQueueManager.QueueItemView<V>> getQueueView(java.lang.Iterable<BuildQueueManager.QueueItemView<V>> previouslyQueuedExecutables)


Copyright © 2014 Atlassian Software Systems Pty Ltd. All Rights Reserved.