Class ExecutableAgentsMatrixImpl
java.lang.Object
com.atlassian.bamboo.buildqueue.manager.ExecutableAgentsMatrixImpl
- All Implemented Interfaces:
ExecutableAgentsMatrix
A simple holder object that stores information about the executable agents on a per requirement basis
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionvoidaddBuildAgent(@NotNull BuildAgent buildAgent) Record an agent matching ALL requirementsvoidaddBuildAgents(@NotNull Collection<BuildAgent> buildAgents) Record a collection of agents matching ALL requirementsvoidaddDedicatedNonMatchingBuildAgent(@NotNull BuildAgent buildAgent) Record build agent dedicated to the job/plan/project but not satisfying all requirementsvoidaddDedicatedNonMatchingEphemeralTemplate(@NotNull EphemeralAgentTemplate template) Record an ephemeral template dedicated to the job/plan/project but not satisfying all requirementsvoidaddDedicatedNonMatchingImage(@NotNull ElasticImageConfiguration elasticImageConfiguration) Record image configuration dedicated to the job/plan/project but not satisfying all requirementsvoidaddEphemeralTemplateMatch(@NotNull EphemeralAgentTemplate ephemeralAgentTemplate) Record an ephemeral template that matches all requirementsvoidaddEphemeralTemplateToMatrix(@NotNull String requirementKey, @NotNull EphemeralAgentTemplate template) Record an ephemeral template matching a requirement.voidaddImageMatch(@NotNull ElasticImageConfiguration imageMatch) Record an image that matches all requirementsvoidaddImageToMatrix(@NotNull String requirementKey, @NotNull ElasticImageConfiguration image) Record an image matching a requirement.booleanaddRequirementIfNoMatches(@NotNull ImmutableRequirement requirement) Record a requirement if it does not have any matching agent, image or ephemeral template.voidaddRequirementWithNoAgentMatch(@NotNull ImmutableRequirement requirement) Record a requirement that does not have any matching agents.voidaddRequirementWithNoImageMatch(@NotNull ImmutableRequirement requirement) Record a requirement that does not have any matching image.@NotNull SortedSet<BuildAgent>Get a set of agents that match ALL requirements.@NotNull Collection<BuildAgent>getBuildAgents(@NotNull String key) @NotNull SortedSet<BuildAgent>@NotNull List<ElasticImageConfiguration>@NotNull List<EphemeralAgentTemplate>Get a set of ephemeral templates that match ALL requirements.@NotNull Collection<EphemeralAgentTemplate>getEphemeralTemplatesFromMatrix(@NotNull String requirementKey) @NotNull Collection<ElasticImageConfiguration>getImageFromMatrix(@NotNull String requirementKey) @NotNull List<ElasticImageConfiguration>Get a set of elastic images that match ALL requirements.@NotNull Collection<BuildAgent>Get a set of agents that match ALL requirements AND are currently enabled and online.int@NotNull Set<ImmutableRequirement>Retrieve a list of all requirements which were not matched by any agent or image.booleanChecks whether the executable uses the docker configuration.booleanCheck if elastic support is enabledbooleanvoidput(@NotNull String key, @NotNull BuildAgent value) Record an agent matching a requirement.voidsetElasticBambooEnabled(boolean elasticBambooEnabled) Mark whether elastic support is enabled or notvoidsetEphemeralTemplatesEnabled(boolean ephemeralTemplatesEnabled) voidsetRequirementCount(int requirementCount) voidsetUsesDockerConfiguration(boolean usesDockerConfiguration) Sets whether the executable uses the docker configuration.
-
Constructor Details
-
ExecutableAgentsMatrixImpl
public ExecutableAgentsMatrixImpl()
-
-
Method Details
-
put
Description copied from interface:ExecutableAgentsMatrixRecord an agent matching a requirement. May also get recorded to match all requirements- Specified by:
putin interfaceExecutableAgentsMatrix- Parameters:
key- of requirement matchedvalue- that matches
-
getBuildAgents
- Specified by:
getBuildAgentsin interfaceExecutableAgentsMatrix- Parameters:
key- of requirement- Returns:
- a collection of agents that match a single requirement
-
getBuildAgents
Description copied from interface:ExecutableAgentsMatrixGet a set of agents that match ALL requirements. i.e. these agents could build the executable. Includes offline and disabled agents- Specified by:
getBuildAgentsin interfaceExecutableAgentsMatrix- Returns:
- a set of agents that match all requirements.
-
getOnlineEnabledBuildAgents
Description copied from interface:ExecutableAgentsMatrixGet a set of agents that match ALL requirements AND are currently enabled and online. i.e. these agents could build the executable now- Specified by:
getOnlineEnabledBuildAgentsin interfaceExecutableAgentsMatrix- Returns:
- set of online enabled build agents that match all requirements
-
addBuildAgent
Description copied from interface:ExecutableAgentsMatrixRecord an agent matching ALL requirements- Specified by:
addBuildAgentin interfaceExecutableAgentsMatrix- Parameters:
buildAgent- that matches
-
addBuildAgents
Description copied from interface:ExecutableAgentsMatrixRecord a collection of agents matching ALL requirements- Specified by:
addBuildAgentsin interfaceExecutableAgentsMatrix- Parameters:
buildAgents- that match
-
addRequirementWithNoAgentMatch
Description copied from interface:ExecutableAgentsMatrixRecord a requirement that does not have any matching agents.- Specified by:
addRequirementWithNoAgentMatchin interfaceExecutableAgentsMatrix- Parameters:
requirement- that didn't have a match
-
addRequirementWithNoImageMatch
Description copied from interface:ExecutableAgentsMatrixRecord a requirement that does not have any matching image.- Specified by:
addRequirementWithNoImageMatchin interfaceExecutableAgentsMatrix- Parameters:
requirement- that didn't have a match
-
getRequirementsWithNoMatches
Description copied from interface:ExecutableAgentsMatrixRetrieve a list of all requirements which were not matched by any agent or image. If elastic capability is disabled it will ignore images and just look at agent matches.- Specified by:
getRequirementsWithNoMatchesin interfaceExecutableAgentsMatrix- Returns:
- Set of requirements with no matches
-
setElasticBambooEnabled
public void setElasticBambooEnabled(boolean elasticBambooEnabled) Description copied from interface:ExecutableAgentsMatrixMark whether elastic support is enabled or not- Specified by:
setElasticBambooEnabledin interfaceExecutableAgentsMatrix- Parameters:
elasticBambooEnabled- whether elastic bamboo is enabled
-
isElasticBambooEnabled
public boolean isElasticBambooEnabled()Description copied from interface:ExecutableAgentsMatrixCheck if elastic support is enabled- Specified by:
isElasticBambooEnabledin interfaceExecutableAgentsMatrix- Returns:
- true if elastic bamboo is enabled, otherwise false
-
isEphemeralTemplatesEnabled
public boolean isEphemeralTemplatesEnabled()- Specified by:
isEphemeralTemplatesEnabledin interfaceExecutableAgentsMatrix
-
setEphemeralTemplatesEnabled
public void setEphemeralTemplatesEnabled(boolean ephemeralTemplatesEnabled) - Specified by:
setEphemeralTemplatesEnabledin interfaceExecutableAgentsMatrix
-
getRequirementCount
public int getRequirementCount()- Specified by:
getRequirementCountin interfaceExecutableAgentsMatrix- Returns:
- How many requirements were used to generate this matrix
-
setRequirementCount
public void setRequirementCount(int requirementCount) - Specified by:
setRequirementCountin interfaceExecutableAgentsMatrix- Parameters:
requirementCount- How many requirements were used to generate this matrix
-
getImageMatches
Description copied from interface:ExecutableAgentsMatrixGet a set of elastic images that match ALL requirements. i.e. these images could build the executable.- Specified by:
getImageMatchesin interfaceExecutableAgentsMatrix- Returns:
- a list of images that match all requirements.
-
addImageMatch
Description copied from interface:ExecutableAgentsMatrixRecord an image that matches all requirements- Specified by:
addImageMatchin interfaceExecutableAgentsMatrix- Parameters:
imageMatch- image that matches
-
getImageFromMatrix
@NotNull public @NotNull Collection<ElasticImageConfiguration> getImageFromMatrix(@NotNull @NotNull String requirementKey) - Specified by:
getImageFromMatrixin interfaceExecutableAgentsMatrix- Parameters:
requirementKey- of requirement- Returns:
- a collection of images that match a single requirement
-
addImageToMatrix
public void addImageToMatrix(@NotNull @NotNull String requirementKey, @NotNull @NotNull ElasticImageConfiguration image) Description copied from interface:ExecutableAgentsMatrixRecord an image matching a requirement. May also get recorded to match all requirements- Specified by:
addImageToMatrixin interfaceExecutableAgentsMatrix- Parameters:
requirementKey- for requirement that matchesimage- that matches
-
addDedicatedNonMatchingImage
public void addDedicatedNonMatchingImage(@NotNull @NotNull ElasticImageConfiguration elasticImageConfiguration) Description copied from interface:ExecutableAgentsMatrixRecord image configuration dedicated to the job/plan/project but not satisfying all requirements- Specified by:
addDedicatedNonMatchingImagein interfaceExecutableAgentsMatrix
-
addDedicatedNonMatchingBuildAgent
Description copied from interface:ExecutableAgentsMatrixRecord build agent dedicated to the job/plan/project but not satisfying all requirements- Specified by:
addDedicatedNonMatchingBuildAgentin interfaceExecutableAgentsMatrix
-
getDedicatedNonMatchingBuildAgents
- Specified by:
getDedicatedNonMatchingBuildAgentsin interfaceExecutableAgentsMatrix- Returns:
- set of dedicated agents that don't match all requirements
-
getDedicatedNonMatchingImages
- Specified by:
getDedicatedNonMatchingImagesin interfaceExecutableAgentsMatrix- Returns:
- list of dedicated images that don't match all requirements
-
addEphemeralTemplateMatch
public void addEphemeralTemplateMatch(@NotNull @NotNull EphemeralAgentTemplate ephemeralAgentTemplate) Description copied from interface:ExecutableAgentsMatrixRecord an ephemeral template that matches all requirements- Specified by:
addEphemeralTemplateMatchin interfaceExecutableAgentsMatrix- Parameters:
ephemeralAgentTemplate- ephemeral template that matches
-
getEphemeralTemplateMatches
Description copied from interface:ExecutableAgentsMatrixGet a set of ephemeral templates that match ALL requirements. i.e. these templates could build the executable.- Specified by:
getEphemeralTemplateMatchesin interfaceExecutableAgentsMatrix- Returns:
- a list of ephemeral templates that match all requirements.
-
addRequirementIfNoMatches
Description copied from interface:ExecutableAgentsMatrixRecord a requirement if it does not have any matching agent, image or ephemeral template.- Specified by:
addRequirementIfNoMatchesin interfaceExecutableAgentsMatrix- Parameters:
requirement- that didn't have a match
-
addEphemeralTemplateToMatrix
public void addEphemeralTemplateToMatrix(@NotNull @NotNull String requirementKey, @NotNull @NotNull EphemeralAgentTemplate template) Description copied from interface:ExecutableAgentsMatrixRecord an ephemeral template matching a requirement. May also get recorded to match all requirements- Specified by:
addEphemeralTemplateToMatrixin interfaceExecutableAgentsMatrix- Parameters:
requirementKey- for requirement that matchestemplate- that matches
-
getEphemeralTemplatesFromMatrix
@NotNull public @NotNull Collection<EphemeralAgentTemplate> getEphemeralTemplatesFromMatrix(@NotNull @NotNull String requirementKey) - Specified by:
getEphemeralTemplatesFromMatrixin interfaceExecutableAgentsMatrix- Parameters:
requirementKey- of requirement- Returns:
- a collection of ephemeral templates that match a single requirement
-
getDedicatedNonMatchingEphemeralTemplates
- Specified by:
getDedicatedNonMatchingEphemeralTemplatesin interfaceExecutableAgentsMatrix- Returns:
- list of dedicated ephemeral templates that don't match all the requirements
-
addDedicatedNonMatchingEphemeralTemplate
public void addDedicatedNonMatchingEphemeralTemplate(@NotNull @NotNull EphemeralAgentTemplate template) Description copied from interface:ExecutableAgentsMatrixRecord an ephemeral template dedicated to the job/plan/project but not satisfying all requirements- Specified by:
addDedicatedNonMatchingEphemeralTemplatein interfaceExecutableAgentsMatrix
-
getUsesDockerConfiguration
public boolean getUsesDockerConfiguration()Description copied from interface:ExecutableAgentsMatrixChecks whether the executable uses the docker configuration.- Specified by:
getUsesDockerConfigurationin interfaceExecutableAgentsMatrix
-
setUsesDockerConfiguration
public void setUsesDockerConfiguration(boolean usesDockerConfiguration) Description copied from interface:ExecutableAgentsMatrixSets whether the executable uses the docker configuration.- Specified by:
setUsesDockerConfigurationin interfaceExecutableAgentsMatrix
-