Interface BuildQueue

    • Method Detail

      • applyOrder

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

        void moveTop​(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​(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
        List<SQueuedBuild> getItems()
        Returns all queued items.
        Returns:
        list of currently queued items.
      • getItems

        @NotNull
        List<SQueuedBuild> getItems​(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
                                String buildTypeId,
                                @Nullable
                                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
                                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
                          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
                         Collection<String> itemIds,
                         @Nullable
                         SUser user,
                         @Nullable
                         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
                                Collection<SQueuedBuild> items,
                                @Nullable
                                SUser user,
                                @Nullable
                                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