Interface AgentQueueAccessor

    • Method Detail

      • takeBuildContext

        @Deprecated
        @Nullable
        @Nullable CommonContext takeBuildContext​(long agentId)
                                          throws InterruptedException
        Deprecated.
        since 7.1 use {takeContext(long)}
        Takes a CommonContext from the queue, blocking until one is available.

        The lock on the build is not released. The caller should call com.atlassian.bamboo.build.BuildExecutionManager#finishBuild(PlanResultKey) to release this lock when ready.

        Parameters:
        agentId - the id of the agent that is taking the build context.
        Returns:
        The CommonContext, null in case of timeout on retrieval.
        Throws:
        InterruptedException - if the calling Thread is interrupted.
      • takeContext

        @NotNull
        @NotNull AgentQueueAccessor.QueueAccessResult takeContext​(long agentId,
                                                                  @Nullable
                                                                  @Nullable ResultKey resultKey)
                                                           throws InterruptedException
        If resultKey is not null, takes a specific CommonContext from the queue or nothing if there's no job with specified key in the queue. If resultKey is null, behaved identically to takeContext(long).

        The lock on the build is not released. The caller should call com.atlassian.bamboo.build.BuildExecutionManager#finishBuild(PlanResultKey) to release this lock when ready.

        Parameters:
        agentId - the id of the agent that is taking the build context.
        resultKey - of the job that agent expects to receive
        Returns:
        The AgentQueueAccessor.QueueAccessResult containing: CommonContext on success, error message on error, nulls in case of timeout on retrieval.
        Throws:
        InterruptedException - if the calling Thread is interrupted.
        Since:
        9.1