|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
public interface AgentManager
Manages the LocalBuildAgent
and PipelineDefinition
funnily enough. The class is fully synchronized.
Nested Class Summary | |
---|---|
static class |
AgentManager.DisabledAgentsInclusion
|
static class |
AgentManager.OfflineAgentsInclusion
|
Method Summary | ||
---|---|---|
void |
abandonBuild(BuildAgent remoteAgent,
boolean agentStartingUp)
|
|
boolean |
allowNewElasticAgent()
Allow an elastic agent to register and come online? Based on licensing restrictions. |
|
boolean |
allowNewElasticAgents(int numOfAgentsToCreate)
Allow a specified number of elastic agents to register and come online? Based on licensing restrictions. |
|
boolean |
allowNewLocalAgent()
Allow a local agent to come online? Based on licensing restrictions. |
|
boolean |
allowNewRemoteAgent()
Allow a remote agent to register and come online? Based on licensing restrictions. |
|
boolean |
allowNewRemoteAgents(int numAgentsToCreate)
Allow a specified number of remote agents to register and come online? Based on licensing restrictions. |
|
boolean |
checkPipelinesAreDisabled()
|
|
void |
createDefaultAgent()
sets up a default local agent if no local agent exists |
|
void |
createLocalAgent(LocalAgentDefinition pipelineDefinition)
Create a new local agent. |
|
void |
disableAllAgents()
Disable all pipelines |
|
void |
enableAllAgents()
Enable all pipelines |
|
|
executeIfIdle(java.util.concurrent.Callable<T> callable)
Executes a given Callable only if no builds are in progress. |
|
java.util.Map<java.lang.Long,PipelineDefinition> |
findAllAgentsForAgentIds(java.util.Collection<java.lang.Long> agentIds)
Returns a Map of PipelineDefinition s keyed by their id |
|
java.util.Collection<BuildAgent> |
getActiveAndEnabledAgents()
Returns agents that are enabled and online |
|
BuildAgent |
getAgent(long agentId)
|
|
long |
getAgentCount(java.lang.Class<ElasticAgentDefinition> agentDefinitionClass)
Retrieves the amount of agents of given type stored in the database |
|
PipelineDefinition |
getAgentDefinition(java.lang.Long agentId)
|
|
PipelineDefinition |
getAgentDefinitionByName(java.lang.String name)
Retrieve a pipelineDefinition by name. |
|
java.util.List<PipelineDefinition> |
getAgentDefinitionsWithNameLike(java.lang.String likeName)
Retrun a list of agents whose name is like the provided string. |
|
java.util.List<BuildAgent> |
getAllAgents()
|
|
java.util.List<ElasticAgentDefinition> |
getAllElasticAgentDefinitions()
Deprecated. since 3.2 This method can potentially pull thousands of agents definitions from the database and incapacitate the whole server, consider using getAllElasticAgentDefinitions(java.util.Collection) instead |
|
java.util.List<ElasticAgentDefinition> |
getAllElasticAgentDefinitions(java.util.Collection<java.lang.String> instanceIds)
Retrieve elastic agent definitions from db. |
|
java.util.List<ElasticAgentDefinition> |
getAllElasticAgentDefinitions(int firstResult,
int maxResults)
Retrieve most recently terminated elastic agent definitions from db, ordered by termination time, descending. |
|
java.util.List<LocalBuildAgent> |
getAllLocalAgents()
Returns all LocalBuildAgent objects |
|
java.util.List<BuildAgent> |
getAllNonElasticAgents()
|
|
java.util.List<PipelineDefinition> |
getAllPersistedAgentDefinitions()
Retrieves a list of all agent definitions stored in the database. |
|
java.util.List<BuildAgent> |
getAllRemoteAgents()
Gets all remote agents in the system. |
|
java.util.List<BuildAgent> |
getAllRemoteAgents(boolean onlineOnly)
Get remote agents. |
|
java.util.Collection<BuildAgent> |
getBusyBuildAgents()
Gets a collection agents that are currently building or cancelling a build |
|
java.util.Collection<BuildAgent> |
getExecutableAgents(RequirementSet requirements,
AgentManager.DisabledAgentsInclusion includeDisabled,
AgentManager.OfflineAgentsInclusion includeOffline)
Gets all agents which can run a given RequirementSet |
|
java.util.Collection<BuildAgent> |
getExecutableAgents(RequirementSet requirementSet,
boolean includeDisabled)
Gets all agents which can run a given RequirementSet |
|
ExecutableAgentsMatrix |
getExecutableAgentsMatrix(RequirementSet requirementSet,
AgentManager.DisabledAgentsInclusion includeDisabled,
AgentManager.OfflineAgentsInclusion includeOffline)
Returns a matrix of how many agents match each requirement in the set. |
|
ExecutableAgentsMatrix |
getExecutableAgentsMatrix(RequirementSet requirementSet,
boolean includeDisabled)
Returns a matrix of how many agents match each requirement in the set. |
|
java.util.Collection<ElasticImageConfiguration> |
getExecutableImages(RequirementSet requirementSet)
Retrieves a list of all images which satisfy the given requirements set. |
|
java.util.Collection<ElasticImageConfiguration> |
getExecutableImages(RequirementSet requirementSet,
boolean includeDisabled)
Retrieves a list of all images which satisfy the given requirements set. |
|
LocalBuildAgent |
getLocalAgent(long pipelineId)
Returns the pipeline that matches the passed id |
|
java.util.List<BuildAgent> |
getOnlineElasticAgents()
Retrieve all online elastic build agents. |
|
void |
initAgents()
Inits the local agents Must be ran before any other methods. |
|
void |
removeAgent(long agentId)
Removes the passed agent |
|
void |
saveAnyPipeline(PipelineDefinition pipelineDefinition)
Stores a pipeline PipelineDefinition of any type (elastic, local, remote) |
|
void |
saveElasticPipeline(ElasticAgentDefinition pipelineDefinition)
Stores the elastic PipelineDefinition |
|
void |
savePipeline(PipelineDefinition pipelineDefinition)
Stores the PipelineDefinition . |
|
void |
startLocalAgents()
Starts all current LocalBuildAgent objects |
|
void |
stopAgent(BuildAgent agent)
Performs any other operations required when an agent goes offline, such as updating the status and shutdown time. |
|
void |
stopLocalAgents()
Stops all LocalBuildAgent |
Method Detail |
---|
void createDefaultAgent()
void initAgents()
void startLocalAgents()
LocalBuildAgent
objects
void stopLocalAgents() throws java.lang.InterruptedException
LocalBuildAgent
java.lang.InterruptedException
@NotNull java.util.List<LocalBuildAgent> getAllLocalAgents()
LocalBuildAgent
objects
LocalBuildAgent
objects, or an empty collection if none exists.@NotNull java.util.List<BuildAgent> getAllRemoteAgents()
@NotNull java.util.List<BuildAgent> getAllRemoteAgents(boolean onlineOnly)
onlineOnly
- - only return those agents which are online currently.
@Deprecated @NotNull java.util.List<ElasticAgentDefinition> getAllElasticAgentDefinitions()
getAllElasticAgentDefinitions(java.util.Collection)
instead
@NotNull java.util.List<ElasticAgentDefinition> getAllElasticAgentDefinitions(int firstResult, int maxResults)
long getAgentCount(java.lang.Class<ElasticAgentDefinition> agentDefinitionClass)
agentDefinitionClass
- agent type
@NotNull java.util.List<ElasticAgentDefinition> getAllElasticAgentDefinitions(@NotNull java.util.Collection<java.lang.String> instanceIds)
instanceIds
- the instances ids on which the agents were running
@NotNull java.util.List<BuildAgent> getOnlineElasticAgents()
@NotNull java.util.List<BuildAgent> getAllAgents()
@NotNull java.util.List<BuildAgent> getAllNonElasticAgents()
@NotNull java.util.Collection<BuildAgent> getBusyBuildAgents()
BuildAgent
@NotNull java.util.Collection<BuildAgent> getActiveAndEnabledAgents()
BuildAgent
@NotNull java.util.Collection<BuildAgent> getExecutableAgents(RequirementSet requirementSet, boolean includeDisabled)
RequirementSet
@NotNull java.util.Collection<BuildAgent> getExecutableAgents(RequirementSet requirements, AgentManager.DisabledAgentsInclusion includeDisabled, AgentManager.OfflineAgentsInclusion includeOffline)
RequirementSet
@NotNull java.util.Collection<ElasticImageConfiguration> getExecutableImages(@NotNull RequirementSet requirementSet)
requirementSet
- to check
ElasticImageConfiguration
which can build the requirement set (currently this can be 1 or none)@NotNull java.util.Collection<ElasticImageConfiguration> getExecutableImages(@NotNull RequirementSet requirementSet, boolean includeDisabled)
requirementSet
- to checkincludeDisabled
- whether to include images configurations which are currently disabled
ElasticImageConfiguration
which can build the requirement set (currently this can
be 1 or none)void savePipeline(PipelineDefinition pipelineDefinition)
PipelineDefinition
. Updates any caches so calls to getLocalAgent(long)
will return the
LocalBuildAgent
returns with the new definition
pipelineDefinition
- - Must not be nullvoid saveElasticPipeline(@NotNull ElasticAgentDefinition pipelineDefinition)
PipelineDefinition
pipelineDefinition
- - Must not be nullLocalBuildAgent getLocalAgent(long pipelineId)
pipelineId
-
LocalBuildAgent
object. Null if pipeline does not exist@Nullable BuildAgent getAgent(long agentId)
@Nullable PipelineDefinition getAgentDefinition(@NotNull java.lang.Long agentId)
java.util.Map<java.lang.Long,PipelineDefinition> findAllAgentsForAgentIds(@NotNull java.util.Collection<java.lang.Long> agentIds)
PipelineDefinition
s keyed by their id
agentIds
-
void disableAllAgents()
void enableAllAgents()
boolean checkPipelinesAreDisabled()
<T> T executeIfIdle(java.util.concurrent.Callable<T> callable) throws java.lang.Exception
Executes a given Callable
only if no builds are in progress. Builds are prevented from starting while
the Callable
executes.
callable
- the Callable
to be executed
callable
BambooBusyException
- if builds are in progress
java.lang.Exception
- if thrown by callable
void createLocalAgent(LocalAgentDefinition pipelineDefinition) throws BambooLicenseException
pipelineDefinition
-
BambooLicenseException
void removeAgent(long agentId) throws java.util.concurrent.TimeoutException
agentId
-
java.util.concurrent.TimeoutException
@NotNull ExecutableAgentsMatrix getExecutableAgentsMatrix(@NotNull RequirementSet requirementSet, boolean includeDisabled)
requirementSet
- includeDisabled
-
@NotNull ExecutableAgentsMatrix getExecutableAgentsMatrix(@NotNull RequirementSet requirementSet, AgentManager.DisabledAgentsInclusion includeDisabled, AgentManager.OfflineAgentsInclusion includeOffline)
requirementSet
- includeDisabled
- includeOffline
-
boolean allowNewRemoteAgent()
boolean allowNewRemoteAgents(int numAgentsToCreate)
boolean allowNewElasticAgent()
boolean allowNewElasticAgents(int numOfAgentsToCreate)
boolean allowNewLocalAgent()
void stopAgent(@NotNull BuildAgent agent)
agent
- to be stoppedjava.util.List<PipelineDefinition> getAllPersistedAgentDefinitions()
void abandonBuild(@NotNull BuildAgent remoteAgent, boolean agentStartingUp)
@Nullable PipelineDefinition getAgentDefinitionByName(@NotNull java.lang.String name)
name
- of the agent to find
@NotNull java.util.List<PipelineDefinition> getAgentDefinitionsWithNameLike(@NotNull java.lang.String likeName)
likeName
- the string to match
void saveAnyPipeline(@NotNull PipelineDefinition pipelineDefinition)
PipelineDefinition
of any type (elastic, local, remote)
pipelineDefinition
- - Must not be null
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |