com.atlassian.bamboo.v2.build.agent.capability
Class CapabilitySetManagerImpl

java.lang.Object
  extended by com.atlassian.bamboo.v2.build.agent.capability.CapabilitySetManagerImpl
All Implemented Interfaces:
CapabilitySetManager

public class CapabilitySetManagerImpl
extends java.lang.Object
implements CapabilitySetManager


Constructor Summary
CapabilitySetManagerImpl()
           
 
Method Summary
 CapabilitySet createAgentCapabilitySet(LocalAgentDefinition pipelineDefinition)
          Create an agent scope capability set for local agents
 CapabilitySet createAgentCapabilitySet(RemoteAgentDefinition pipelineDefinition)
          Create an agent scope capability set for remote agents
 java.util.List<java.lang.String> findUniqueCapabilityKeys()
          Finds all the distinct capability keys
 ReadOnlyCapabilitySet getCombinedCapabilitySet(CapabilitySet agentCapabilitySet)
          Gets a combined "effective" capabilitySet given an agent's capabilitySet.
 ReadOnlyCapabilitySet getCombinedCapabilitySet(CapabilitySet agentCapabilitySet, 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 the CapabilityScope.SHARED capabilities if there's a precise key match.
 ReadOnlyCapabilitySet getCombinedCapabilitySet(long agentId)
          Gets the ReadOnlyCapabilitySet for the agent.
 ElasticImageConfiguration getElasticImage(CapabilitySet capabilitySet)
           
 java.util.Collection<Build> getExecutableBuilds(ReadOnlyCapabilitySet capabilitySet)
          Collection of builds for which this capability set can meet the requirements of
 PipelineDefinition getPipelineDefinition(CapabilitySet capabilitySet)
           
 CapabilitySet getSharedCapabilitySet(CapabilitySet agentCapabilitySet)
          Gets the shared capabilities depending on agentCapability type.
 CapabilitySet getSharedLocalCapabilitySet()
          Gets the locally shared capabilities
 CapabilitySet getSharedRemoteCapabilitySet()
          Gets the remotely shared capabilities
 java.util.Collection<Capability> getSystemCapabilities(java.lang.String type)
          Collection of Capability which have keys prefixed with system.{type} Used to identify Bamboo system capabilities for Builders / JDKs.
 java.util.Collection<Capability> getSystemCapabilitiesByKey(java.lang.String key)
          Collection of Capability which have the specified key
 java.util.Collection<java.lang.String> getSystemCapabilityKeys(java.lang.String type, boolean isElasticEnabled)
          Returns a list of Capability Keys that match the given type
 void saveCapabilitySet(CapabilitySet capabilitySet)
          Saves a capability set
 void setAgentDao(AgentDao agentDao)
           
 void setBuildManager(BuildManager buildManager)
           
 void setCapabilityRequirementsMatcher(CapabilityRequirementsMatcher capabilityRequirementsMatcher)
           
 void setEventManager(com.atlassian.event.EventManager eventManager)
           
 void setImageCapabilityDao(ImageCapabilitySetDao imageCapabilityDao)
           
 void setLocalCapabilityDao(LocalCapabilitySetDao localCapabilityDao)
           
 void setRemoteCapabilityDao(RemoteCapabilitySetDao remoteCapabilityDao)
           
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

CapabilitySetManagerImpl

public CapabilitySetManagerImpl()
Method Detail

getSharedLocalCapabilitySet

public CapabilitySet getSharedLocalCapabilitySet()
Description copied from interface: CapabilitySetManager
Gets the locally shared capabilities

Specified by:
getSharedLocalCapabilitySet in interface CapabilitySetManager
Returns:
CapabilitySet

getSharedRemoteCapabilitySet

public CapabilitySet getSharedRemoteCapabilitySet()
Description copied from interface: CapabilitySetManager
Gets the remotely shared capabilities

Specified by:
getSharedRemoteCapabilitySet in interface CapabilitySetManager
Returns:
CapabilitySet

getSharedCapabilitySet

@Nullable
public CapabilitySet getSharedCapabilitySet(@NotNull
                                                     CapabilitySet agentCapabilitySet)
Description copied from interface: CapabilitySetManager
Gets the shared capabilities depending on agentCapability type.

Specified by:
getSharedCapabilitySet in interface CapabilitySetManager
Returns:
shared capability set, null if neither Local nor Remote capability set passed as parameter

getPipelineDefinition

@Nullable
public PipelineDefinition getPipelineDefinition(@NotNull
                                                         CapabilitySet capabilitySet)
Specified by:
getPipelineDefinition in interface CapabilitySetManager

getElasticImage

@Nullable
public ElasticImageConfiguration getElasticImage(@NotNull
                                                          CapabilitySet capabilitySet)
Specified by:
getElasticImage in interface CapabilitySetManager

getCombinedCapabilitySet

@NotNull
public ReadOnlyCapabilitySet getCombinedCapabilitySet(@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 the CapabilityScope. The agent capabilitySet will override capabilities in the CapabilityScope.SHARED capabilities if there's a precise key match.

Specified by:
getCombinedCapabilitySet in interface CapabilitySetManager
Returns:

getCombinedCapabilitySet

public ReadOnlyCapabilitySet getCombinedCapabilitySet(@NotNull
                                                      CapabilitySet agentCapabilitySet,
                                                      @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 the CapabilityScope.SHARED capabilities if there's a precise key match.

Specified by:
getCombinedCapabilitySet in interface CapabilitySetManager
Returns:

getCombinedCapabilitySet

@Nullable
public ReadOnlyCapabilitySet getCombinedCapabilitySet(long agentId)
Description copied from interface: CapabilitySetManager
Gets the ReadOnlyCapabilitySet for the agent.

Specified by:
getCombinedCapabilitySet in interface CapabilitySetManager
Returns:

createAgentCapabilitySet

@NotNull
public CapabilitySet createAgentCapabilitySet(@NotNull
                                                      LocalAgentDefinition pipelineDefinition)
Description copied from interface: CapabilitySetManager
Create an agent scope capability set for local agents

Specified by:
createAgentCapabilitySet in interface CapabilitySetManager
Returns:

createAgentCapabilitySet

@NotNull
public CapabilitySet createAgentCapabilitySet(@NotNull
                                                      RemoteAgentDefinition pipelineDefinition)
Description copied from interface: CapabilitySetManager
Create an agent scope capability set for remote agents

Specified by:
createAgentCapabilitySet in interface CapabilitySetManager
Returns:

saveCapabilitySet

public void saveCapabilitySet(@NotNull
                              CapabilitySet capabilitySet)
Description copied from interface: CapabilitySetManager
Saves a capability set

Specified by:
saveCapabilitySet in interface CapabilitySetManager

getSystemCapabilityKeys

@NotNull
public java.util.Collection<java.lang.String> getSystemCapabilityKeys(@NotNull
                                                                              java.lang.String type,
                                                                              boolean isElasticEnabled)
Description copied from interface: CapabilitySetManager
Returns a list of Capability Keys that match the given type

Specified by:
getSystemCapabilityKeys in interface CapabilitySetManager
Parameters:
type - eg "builder" or "jdk"
Returns:
list of capability keys eg. "system.builder.mvn2.Maven 2"

getSystemCapabilities

@NotNull
public java.util.Collection<Capability> getSystemCapabilities(@NotNull
                                                                      java.lang.String type)
Description copied from interface: CapabilitySetManager
Collection of Capability which have keys prefixed with system.{type} Used to identify Bamboo system capabilities for Builders / JDKs.

Specified by:
getSystemCapabilities in interface CapabilitySetManager
Returns:

getSystemCapabilitiesByKey

@NotNull
public java.util.Collection<Capability> getSystemCapabilitiesByKey(@NotNull
                                                                           java.lang.String key)
Description copied from interface: CapabilitySetManager
Collection of Capability which have the specified key

Specified by:
getSystemCapabilitiesByKey in interface CapabilitySetManager
Returns:

getExecutableBuilds

@NotNull
public java.util.Collection<Build> getExecutableBuilds(@Nullable
                                                               ReadOnlyCapabilitySet capabilitySet)
Description copied from interface: CapabilitySetManager
Collection of builds for which this capability set can meet the requirements of

Specified by:
getExecutableBuilds in interface CapabilitySetManager
Returns:

findUniqueCapabilityKeys

@NotNull
public java.util.List<java.lang.String> findUniqueCapabilityKeys()
Description copied from interface: CapabilitySetManager
Finds all the distinct capability keys

Specified by:
findUniqueCapabilityKeys in interface CapabilitySetManager
Returns:

setLocalCapabilityDao

public void setLocalCapabilityDao(LocalCapabilitySetDao localCapabilityDao)

setRemoteCapabilityDao

public void setRemoteCapabilityDao(RemoteCapabilitySetDao remoteCapabilityDao)

setImageCapabilityDao

public void setImageCapabilityDao(ImageCapabilitySetDao imageCapabilityDao)

setBuildManager

public void setBuildManager(BuildManager buildManager)

setCapabilityRequirementsMatcher

public void setCapabilityRequirementsMatcher(CapabilityRequirementsMatcher capabilityRequirementsMatcher)

setEventManager

public void setEventManager(com.atlassian.event.EventManager eventManager)

setAgentDao

public void setAgentDao(AgentDao agentDao)


Copyright © 2010 Atlassian. All Rights Reserved.