Interface ExecutableAgentsHelper

  • All Known Implementing Classes:
    ExecutableAgentsHelperImpl

    @Internal
    public interface ExecutableAgentsHelper
    Utility class to determine which agents can build a Plan
    • Method Detail

      • planHasExecutableAgents

        boolean planHasExecutableAgents​(@NotNull
                                        @NotNull PlanKey planKey,
                                        boolean includeDisabled)
        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

        boolean planHasExecutableAgents​(@NotNull
                                        @NotNull PlanResultKey planResultKey)
        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
      • 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 check
        ephemeralAgentTemplate - template to check
        Returns:
        true if the template is applicable for the query, false otherwise
        Since:
        9.4
      • 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.
      • 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 and BuildAgent.isRequestedToBeStopped() is true, the system will re-request the agent stop.