Class CapabilitySetManagerImpl
java.lang.Object
com.atlassian.bamboo.v2.build.agent.capability.CapabilitySetManagerImpl
- All Implemented Interfaces:
CapabilitySetManager
,RemotedCapabilitySetManager
-
Constructor Summary
-
Method Summary
Modifier and TypeMethodDescription@NotNull CapabilitySet
createAgentCapabilitySet
(@NotNull LocalAgentDefinition pipelineDefinition) Create an agent scope capability set for local agents@NotNull CapabilitySet
createAgentCapabilitySet
(@NotNull RemoteAgentDefinition pipelineDefinition) Create an agent scope capability set for remote agentsFinds all the distinct capability keys@Nullable ReadOnlyCapabilitySet
getCombinedCapabilitySet
(long agentId) Gets theReadOnlyCapabilitySet
for the agent.@NotNull ReadOnlyCapabilitySet
getCombinedCapabilitySet
(@NotNull CapabilitySet agentCapabilitySet) Gets a combined "effective" capabilitySet given an agent's capabilitySet.getCombinedCapabilitySet
(@NotNull CapabilitySet agentCapabilitySet, @Nullable CapabilitySet sharedCapabilitySet) Gets a combined "effective" capabilitySet given an agent's capability set and a shared capability set The agent capabilitySet will override capabilities in theCapabilityScope.SHARED
capabilities if there's a precise key match.@Nullable ElasticImageConfiguration
getElasticImage
(@NotNull CapabilitySet capabilitySet) @Nullable PipelineDefinition
getPipelineDefinition
(@NotNull CapabilitySet capabilitySet) @Nullable CapabilitySet
Gets the locally shared capabilitiesGets the remotely shared capabilities@NotNull Collection<Capability>
getSystemCapabilities
(@NotNull String type) Collection ofCapability
which have keys prefixed with system.{type} Used to identify Bamboo system capabilities for Builders / JDKs.@NotNull Collection<Capability>
getSystemCapabilitiesByKey
(@NotNull String key) Collection ofCapability
which have the specified key@NotNull Collection<String>
getSystemCapabilityKeys
(@NotNull String type, boolean isElasticEnabled) Returns a list of Capability Keys that match the given typevoid
saveCapabilitySet
(@NotNull CapabilitySet capabilitySet) Saves a capability set
-
Constructor Details
-
CapabilitySetManagerImpl
public CapabilitySetManagerImpl()
-
-
Method Details
-
getPipelineDefinition
@Nullable public @Nullable PipelineDefinition getPipelineDefinition(@NotNull @NotNull CapabilitySet capabilitySet) - Specified by:
getPipelineDefinition
in interfaceCapabilitySetManager
-
getElasticImage
@Nullable public @Nullable ElasticImageConfiguration getElasticImage(@NotNull @NotNull CapabilitySet capabilitySet) - Specified by:
getElasticImage
in interfaceCapabilitySetManager
-
getCombinedCapabilitySet
@NotNull public @NotNull ReadOnlyCapabilitySet getCombinedCapabilitySet(@NotNull @NotNull CapabilitySet agentCapabilitySet) Description copied from interface:CapabilitySetManager
Gets a combined "effective" capabilitySet given an agent's capabilitySet. Will retrieve the shared capabilitySet for the agent based on theCapabilityScope
. The agent capabilitySet will override capabilities in theCapabilityScope.SHARED
capabilities if there's a precise key match.- Specified by:
getCombinedCapabilitySet
in interfaceCapabilitySetManager
- Returns:
-
getCombinedCapabilitySet
public ReadOnlyCapabilitySet getCombinedCapabilitySet(@NotNull @NotNull CapabilitySet agentCapabilitySet, @Nullable @Nullable CapabilitySet sharedCapabilitySet) Description copied from interface:CapabilitySetManager
Gets a combined "effective" capabilitySet given an agent's capability set and a shared capability set The agent capabilitySet will override capabilities in theCapabilityScope.SHARED
capabilities if there's a precise key match.- Specified by:
getCombinedCapabilitySet
in interfaceCapabilitySetManager
-
getCombinedCapabilitySet
Description copied from interface:RemotedCapabilitySetManager
Gets theReadOnlyCapabilitySet
for the agent.- Specified by:
getCombinedCapabilitySet
in interfaceRemotedCapabilitySetManager
- Returns:
-
createAgentCapabilitySet
@NotNull public @NotNull CapabilitySet createAgentCapabilitySet(@NotNull @NotNull LocalAgentDefinition pipelineDefinition) Description copied from interface:CapabilitySetManager
Create an agent scope capability set for local agents- Specified by:
createAgentCapabilitySet
in interfaceCapabilitySetManager
- Returns:
-
createAgentCapabilitySet
@NotNull public @NotNull CapabilitySet createAgentCapabilitySet(@NotNull @NotNull RemoteAgentDefinition pipelineDefinition) Description copied from interface:CapabilitySetManager
Create an agent scope capability set for remote agents- Specified by:
createAgentCapabilitySet
in interfaceCapabilitySetManager
- Returns:
-
saveCapabilitySet
Description copied from interface:CapabilitySetManager
Saves a capability set- Specified by:
saveCapabilitySet
in interfaceCapabilitySetManager
-
getSystemCapabilityKeys
@NotNull public @NotNull Collection<String> getSystemCapabilityKeys(@NotNull @NotNull String type, boolean isElasticEnabled) Description copied from interface:CapabilitySetManager
Returns a list of Capability Keys that match the given type- Specified by:
getSystemCapabilityKeys
in interfaceCapabilitySetManager
- Parameters:
type
- eg "builder" or "jdk"- Returns:
- list of capability keys eg. "system.builder.mvn2.Maven 2"
-
getSystemCapabilities
@NotNull public @NotNull Collection<Capability> getSystemCapabilities(@NotNull @NotNull String type) Description copied from interface:CapabilitySetManager
Collection ofCapability
which have keys prefixed with system.{type} Used to identify Bamboo system capabilities for Builders / JDKs.- Specified by:
getSystemCapabilities
in interfaceCapabilitySetManager
- Returns:
-
getSystemCapabilitiesByKey
@NotNull public @NotNull Collection<Capability> getSystemCapabilitiesByKey(@NotNull @NotNull String key) Description copied from interface:CapabilitySetManager
Collection ofCapability
which have the specified key- Specified by:
getSystemCapabilitiesByKey
in interfaceCapabilitySetManager
- Returns:
-
findUniqueCapabilityKeys
Description copied from interface:CapabilitySetManager
Finds all the distinct capability keys- Specified by:
findUniqueCapabilityKeys
in interfaceCapabilitySetManager
- Returns: