public class ExecutableAgentsHelperImpl extends Object implements ExecutableAgentsHelper
ExecutableAgentsHelper.ExecutableQuery, ExecutableAgentsHelper.ExecutorQuery
Constructor and Description |
---|
ExecutableAgentsHelperImpl(CachedPlanManager cachedPlanManager,
ExecutionStatusProvider executionStatusProvider,
com.atlassian.plugin.PluginAccessor pluginAccessor,
AgentAssignmentService agentAssignmentService,
CapabilityRequirementsMatcher capabilityRequirementsMatcher,
CapabilitySetManager capabilitySetManager,
ElasticInstanceManager elasticInstanceManager,
ElasticImageConfigurationAccessor elasticImageConfigurationAccessor) |
Modifier and Type | Method and Description |
---|---|
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) |
ExecutableAgentsMatrix |
getExecutableAgentsMatrix(@NotNull ExecutableAgentsHelper.ExecutorQuery executorQuery) |
@NotNull Collection<ImmutableBuildable> |
getExecutableBuildables(@NotNull ExecutableAgentsHelper.ExecutableQuery executableQuery)
Collection of buildables for which this agent can execute.
|
@NotNull Collection<Environment> |
getExecutableEnvironments(@NotNull ExecutableAgentsHelper.ExecutableQuery executableQuery) |
Collection<ElasticImageConfiguration> |
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 active agent.
|
boolean |
planHasExecutableAgents(@NotNull PlanResultKey planResultKey)
Checks if a Job can be built on any active agent.
|
void |
resendStopAgentMessageIfRequired(long agentId)
If agent is online and
BuildAgent.isRequestedToBeStopped() is true, the system will re-request the agent stop. |
public ExecutableAgentsHelperImpl(CachedPlanManager cachedPlanManager, ExecutionStatusProvider executionStatusProvider, com.atlassian.plugin.PluginAccessor pluginAccessor, AgentAssignmentService agentAssignmentService, CapabilityRequirementsMatcher capabilityRequirementsMatcher, CapabilitySetManager capabilitySetManager, ElasticInstanceManager elasticInstanceManager, ElasticImageConfigurationAccessor elasticImageConfigurationAccessor)
@NotNull @Transactional public @NotNull Collection<BuildAgent> getExecutableAgents(@NotNull @NotNull ExecutableAgentsHelper.ExecutorQuery executorQuery)
getExecutableAgents
in interface ExecutableAgentsHelper
public boolean canExecute(@NotNull @NotNull BuildAgent buildAgent, @NotNull @NotNull CommonContext context, @NotNull @NotNull ImmutableRequirementSet requirements)
ExecutableAgentsHelper
canExecute
in interface ExecutableAgentsHelper
public ExecutableAgentsMatrix getExecutableAgentsMatrix(@NotNull @NotNull ExecutableAgentsHelper.ExecutorQuery executorQuery)
getExecutableAgentsMatrix
in interface ExecutableAgentsHelper
public boolean isAgentEligibleForReceivingJobs(long agentId)
ExecutableAgentsHelper
isAgentEligibleForReceivingJobs
in interface ExecutableAgentsHelper
public void resendStopAgentMessageIfRequired(long agentId)
ExecutableAgentsHelper
BuildAgent.isRequestedToBeStopped()
is true, the system will re-request the agent stop.resendStopAgentMessageIfRequired
in interface ExecutableAgentsHelper
public Collection<ElasticImageConfiguration> getExecutableImages(@NotNull @NotNull ExecutableAgentsHelper.ExecutorQuery executorQuery)
ExecutableAgentsHelper
getExecutableImages
in interface ExecutableAgentsHelper
@Transactional public boolean planHasExecutableAgents(@NotNull @NotNull PlanKey planKey, boolean includeDisabled)
planHasExecutableAgents
in interface ExecutableAgentsHelper
planKey
- includeDisabled
- indicate whether disabled agents should be included in checking@Transactional public boolean planHasExecutableAgents(@NotNull @NotNull PlanResultKey planResultKey)
planHasExecutableAgents
in interface ExecutableAgentsHelper
planResultKey
- @NotNull public @NotNull Collection<ImmutableBuildable> getExecutableBuildables(@NotNull @NotNull ExecutableAgentsHelper.ExecutableQuery executableQuery)
ExecutableAgentsHelper
getExecutableBuildables
in interface ExecutableAgentsHelper
@NotNull public @NotNull Collection<Environment> getExecutableEnvironments(@NotNull @NotNull ExecutableAgentsHelper.ExecutableQuery executableQuery)
getExecutableEnvironments
in interface ExecutableAgentsHelper
Copyright © 2022 Atlassian Software Systems Pty Ltd. All rights reserved.