Package com.atlassian.bamboo.plan
Interface ExecutableAgentsHelper
- All Known Implementing Classes:
ExecutableAgentsHelperImpl
@Internal
public interface ExecutableAgentsHelper
Utility class to determine which agents can build a Plan
-
Nested Class Summary
Modifier and TypeInterfaceDescriptionstatic class
static class
-
Method Summary
Modifier and TypeMethodDescriptionboolean
canExecute
(@NotNull ExecutableAgentsHelper.ExecutorQuery executorQuery, @NotNull EphemeralAgentTemplate ephemeralAgentTemplate) Checks if the given template is applicable for the given query - whether the template meets the query requirements.boolean
canExecute
(@NotNull BuildAgent buildAgent, @NotNull CommonContext context, @NotNull ImmutableRequirementSet requirements) Returns true or false depending on whether the agent can execute the given context, taking into account requirement set and other global settings such as agent assignments.@NotNull Collection<BuildAgent>
getExecutableAgents
(@NotNull ExecutableAgentsHelper.ExecutorQuery executorQuery) getExecutableAgentsMatrix
(@NotNull ExecutableAgentsHelper.ExecutorQuery executorQuery) @NotNull Collection<ImmutableBuildable>
getExecutableBuildables
(@NotNull ExecutableAgentsHelper.ExecutableQuery executableQuery) Collection of buildables for which this agent can execute.@NotNull Collection<ImmutableBuildable>
getExecutableBuildables
(ExecutableAgentsHelper.ExecutableQuery executableQuery, Predicate<? super ImmutableBuildable> filter) Collection of buildables for which this agent can execute.@NotNull Collection<Environment>
getExecutableEnvironments
(@NotNull ExecutableAgentsHelper.ExecutableQuery executableQuery) @NotNull Collection<EphemeralAgentTemplate>
getExecutableEphemeralAgentTemplates
(@NotNull ExecutableAgentsHelper.ExecutorQuery executorQuery) Calculates the list of ephemeral agents templates that are capable of running an agent that can build a Buildable plan.getExecutableImages
(@NotNull ExecutableAgentsHelper.ExecutorQuery executorQuery) Calculates the list of elastic images that are capable of running an agent that can build a Buildable plan.boolean
isAgentEligibleForReceivingJobs
(long agentId) This method checks if agent is eligible to receive new jobs.boolean
planHasExecutableAgents
(@NotNull PlanKey planKey, boolean includeDisabled) Checks if a Buildable can be built on any defined agent.boolean
planHasExecutableAgents
(@NotNull PlanResultKey planResultKey) Checks if a Buildable can be built on any active agent.void
resendStopAgentMessageIfRequired
(long agentId) If agent is online andBuildAgent.isRequestedToBeStopped()
is true, the system will re-request the agent stop.
-
Method Details
-
planHasExecutableAgents
Checks if a Buildable can be built on any defined agent.- Parameters:
planKey
-includeDisabled
- indicate whether disabled agents should be included in checking- Returns:
- Throws:
IllegalArgumentException
- if planKey is not a Buildable key
-
planHasExecutableAgents
Checks if a Buildable can be built on any active agent.- Parameters:
planResultKey
-- Returns:
- Throws:
IllegalArgumentException
- if planResultKey is not a key of running Job
-
getExecutableImages
Collection<ElasticImageConfiguration> getExecutableImages(@NotNull @NotNull ExecutableAgentsHelper.ExecutorQuery executorQuery) Calculates the list of elastic images that are capable of running an agent that can build a Buildable plan. -
getExecutableEphemeralAgentTemplates
@NotNull @NotNull Collection<EphemeralAgentTemplate> getExecutableEphemeralAgentTemplates(@NotNull @NotNull ExecutableAgentsHelper.ExecutorQuery executorQuery) Calculates the list of ephemeral agents templates that are capable of running an agent that can build a Buildable plan.- Returns:
- collection of ephemeral agent templates that match the query
- Since:
- 9.3
-
canExecute
boolean canExecute(@NotNull @NotNull ExecutableAgentsHelper.ExecutorQuery executorQuery, @NotNull @NotNull EphemeralAgentTemplate ephemeralAgentTemplate) Checks if the given template is applicable for the given query - whether the template meets the query requirements.- Parameters:
executorQuery
- query to checkephemeralAgentTemplate
- template to check- Returns:
- true if the template is applicable for the query, false otherwise
- Since:
- 9.4
-
getExecutableAgents
@NotNull @NotNull Collection<BuildAgent> getExecutableAgents(@NotNull @NotNull ExecutableAgentsHelper.ExecutorQuery executorQuery) -
canExecute
boolean canExecute(@NotNull @NotNull BuildAgent buildAgent, @NotNull @NotNull CommonContext context, @NotNull @NotNull ImmutableRequirementSet requirements) Returns true or false depending on whether the agent can execute the given context, taking into account requirement set and other global settings such as agent assignments. -
getExecutableAgentsMatrix
ExecutableAgentsMatrix getExecutableAgentsMatrix(@NotNull @NotNull ExecutableAgentsHelper.ExecutorQuery executorQuery) -
getExecutableBuildables
@NotNull @NotNull Collection<ImmutableBuildable> getExecutableBuildables(@NotNull @NotNull ExecutableAgentsHelper.ExecutableQuery executableQuery) Collection of buildables for which this agent can execute. Checks capabilities and agent assignments -
getExecutableBuildables
@NotNull @NotNull Collection<ImmutableBuildable> getExecutableBuildables(ExecutableAgentsHelper.ExecutableQuery executableQuery, Predicate<? super ImmutableBuildable> filter) Collection of buildables for which this agent can execute. Checks capabilities and agent assignments- Since:
- 10.0
-
getExecutableEnvironments
@NotNull @NotNull Collection<Environment> getExecutableEnvironments(@NotNull @NotNull ExecutableAgentsHelper.ExecutableQuery executableQuery) - Returns:
- collection of environments that can be executed using given set of capabilities/assignments
-
isAgentEligibleForReceivingJobs
boolean isAgentEligibleForReceivingJobs(long agentId) This method checks if agent is eligible to receive new jobs.- Returns:
- true iff agent it's ok to receive jobs (i.e. we haven't requested it's shutdown)
- Since:
- 5.10
-
resendStopAgentMessageIfRequired
void resendStopAgentMessageIfRequired(long agentId) If agent is online andBuildAgent.isRequestedToBeStopped()
is true, the system will re-request the agent stop.
-