Interface BuildQueue


  • public interface BuildQueue
    Presents information about builds are currently in the queue.
    • Method Summary

      All Methods Instance Methods Abstract Methods 
      Modifier and Type Method Description
      void applyOrder​(java.lang.String[] itemIds)
      Applies new order to the build queue.
      SQueuedBuild findQueued​(java.lang.String itemId)
      Searches for an item in queue with specified item id.
      SQueuedBuild findQueued​(java.lang.String buildTypeId, java.lang.Integer agentId)
      Looks for build configuration with specified id scheduled to run on specified agent in the queue.
      SQueuedBuild getFirst()
      Returns first queue element.
      java.util.List<SQueuedBuild> getItems()
      Returns all queued items.
      java.util.List<SQueuedBuild> getItems​(java.lang.String buildTypeId)
      Returns all items currently waiting in queue corresponding to specified build configuration id.
      SQueuedBuild getLast()
      Returns last queue element.
      int getNumberOfItems()
      Returns number of items currently in the queue
      boolean isInQueue​(java.lang.String buildTypeId)
      Returns true if build configuration is already in queue.
      boolean isQueueEmpty()
      Checks if queue is empty.
      void moveBottom​(java.lang.String itemId)
      Moves specified item to the bottom of the queue.
      void moveTop​(java.lang.String itemId)
      Moves specified item to the top of the queue.
      void removeItems​(java.util.Collection<java.lang.String> itemIds, SUser user, java.lang.String comment)
      Removes items with specified ids from the queue
      void removeQueuedBuilds​(java.util.Collection<SQueuedBuild> items, SUser user, java.lang.String comment)
      Removes specified items from the queue
    • Method Detail

      • applyOrder

        void applyOrder​(@NotNull
                        java.lang.String[] itemIds)
        Applies new order to the build queue.
        Parameters:
        itemIds - new order of queue items
      • moveTop

        void moveTop​(java.lang.String itemId)
        Moves specified item to the top of the queue.
        Parameters:
        itemId - id of the item to move to the top of the queue
      • moveBottom

        void moveBottom​(java.lang.String itemId)
        Moves specified item to the bottom of the queue.
        Parameters:
        itemId - id of the item to move to the bottom of the queue
      • getItems

        @NotNull
        java.util.List<SQueuedBuild> getItems()
        Returns all queued items.
        Returns:
        list of currently queued items.
      • getItems

        @NotNull
        java.util.List<SQueuedBuild> getItems​(java.lang.String buildTypeId)
        Returns all items currently waiting in queue corresponding to specified build configuration id.
        Parameters:
        buildTypeId - specified build configuration.
        Returns:
        all items currently waiting in queue corresponding to specified build configuration id.
        Since:
        8.1.5 also returns all personal queued builds corresponding to specified build configuration id.
      • getNumberOfItems

        int getNumberOfItems()
        Returns number of items currently in the queue
        Returns:
        number of items currently in the queue
      • findQueued

        @Nullable
        SQueuedBuild findQueued​(@NotNull
                                java.lang.String buildTypeId,
                                @Nullable
                                java.lang.Integer agentId)
        Looks for build configuration with specified id scheduled to run on specified agent in the queue.
        Parameters:
        buildTypeId - id of build configuration to search for
        agentId - id of the agent. If not null only build configuration scheduled to specified agent will be returned. If null then build configuration which is not scheduled to any specific agent is returned.
        Returns:
        found item or null
      • findQueued

        @Nullable
        SQueuedBuild findQueued​(@NotNull
                                java.lang.String itemId)
        Searches for an item in queue with specified item id.
        Parameters:
        itemId - id of the item to look for.
        Returns:
        found item or null
      • isInQueue

        boolean isInQueue​(@NotNull
                          java.lang.String buildTypeId)
        Returns true if build configuration is already in queue.
        Parameters:
        buildTypeId - id of build configuration
        Returns:
        if the specified configuration is in the queue.
        Since:
        8.1.5 if regular build type id is specified, method also returns true personal build of this configuration is in queue
      • isQueueEmpty

        boolean isQueueEmpty()
        Checks if queue is empty.
        Returns:
        true if queue is empty.
      • getFirst

        @Nullable
        SQueuedBuild getFirst()
        Returns first queue element.
        Returns:
        first queue element, null is queue is empty.
      • getLast

        @Nullable
        SQueuedBuild getLast()
        Returns last queue element.
        Returns:
        last queue element, null is queue is empty.
      • removeItems

        void removeItems​(@NotNull
                         java.util.Collection<java.lang.String> itemIds,
                         @Nullable
                         SUser user,
                         @Nullable
                         java.lang.String comment)
        Removes items with specified ids from the queue
        Parameters:
        itemIds - ids items to remove
        user - user who performs operation
        comment - comment to use for remove operation
      • removeQueuedBuilds

        void removeQueuedBuilds​(@NotNull
                                java.util.Collection<SQueuedBuild> items,
                                @Nullable
                                SUser user,
                                @Nullable
                                java.lang.String comment)
        Removes specified items from the queue
        Parameters:
        items - items to remove
        user - user who performs operation
        comment - comment to use for remove operation
        Since:
        2017.2