|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
public interface LocalAgentManager
Manages the LocalBuildAgent
and PipelineDefinition
funnily enough. The class is fully synchronized.
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)
|
|
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()
Retrieve all elastic agent definitions from db. |
|
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 requirementSet,
boolean includeDisabled)
Gets all agents which can run a given RequirementSet |
|
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. |
|
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 |
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.
@NotNull java.util.List<ElasticAgentDefinition> getAllElasticAgentDefinitions()
@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<ElasticImageConfiguration> getExecutableImages(@NotNull RequirementSet requirementSet)
requirementSet
- to check
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
-
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
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |