Class CapabilitySetManagerImpl
- java.lang.Object
-
- com.atlassian.bamboo.v2.build.agent.capability.CapabilitySetManagerImpl
-
- All Implemented Interfaces:
CapabilitySetManager
,RemotedCapabilitySetManager
public class CapabilitySetManagerImpl extends Object implements CapabilitySetManager
-
-
Constructor Summary
Constructors Constructor Description CapabilitySetManagerImpl()
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description @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 agents@NotNull List<String>
findUniqueCapabilityKeys()
Finds 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.ReadOnlyCapabilitySet
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
getSharedCapabilitySet(@NotNull CapabilitySet agentCapabilitySet)
Gets the shared capabilities depending on agentCapability type.@Nullable CapabilitySet
getSharedLocalCapabilitySet()
Gets the locally shared capabilitiesCapabilitySet
getSharedRemoteCapabilitySet()
Gets 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
-
-
-
Method Detail
-
getSharedLocalCapabilitySet
@Nullable public @Nullable CapabilitySet getSharedLocalCapabilitySet()
Description copied from interface:RemotedCapabilitySetManager
Gets the locally shared capabilities- Specified by:
getSharedLocalCapabilitySet
in interfaceRemotedCapabilitySetManager
- Returns:
CapabilitySet
-
getSharedRemoteCapabilitySet
public CapabilitySet getSharedRemoteCapabilitySet()
Description copied from interface:CapabilitySetManager
Gets the remotely shared capabilities- Specified by:
getSharedRemoteCapabilitySet
in interfaceCapabilitySetManager
- Returns:
CapabilitySet
-
getSharedCapabilitySet
@Nullable public @Nullable CapabilitySet getSharedCapabilitySet(@NotNull @NotNull CapabilitySet agentCapabilitySet)
Description copied from interface:CapabilitySetManager
Gets the shared capabilities depending on agentCapability type.- Specified by:
getSharedCapabilitySet
in interfaceCapabilitySetManager
- Returns:
- shared capability set, null if neither Local nor Remote capability set passed as parameter
-
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
@Nullable public @Nullable ReadOnlyCapabilitySet getCombinedCapabilitySet(long agentId)
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
public void saveCapabilitySet(@NotNull @NotNull CapabilitySet capabilitySet)
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
@NotNull public @NotNull List<String> findUniqueCapabilityKeys()
Description copied from interface:CapabilitySetManager
Finds all the distinct capability keys- Specified by:
findUniqueCapabilityKeys
in interfaceCapabilitySetManager
- Returns:
-
-