Class AgentManagerImpl
- java.lang.Object
-
- com.atlassian.bamboo.buildqueue.manager.AgentManagerImpl
-
- All Implemented Interfaces:
AgentManager,LocalAgentManager
public class AgentManagerImpl extends Object implements AgentManager, LocalAgentManager
-
-
Field Summary
-
Fields inherited from interface com.atlassian.bamboo.buildqueue.manager.AgentManager
DEFAULT_AGENT_NAME
-
-
Constructor Summary
Constructors Constructor Description AgentManagerImpl(AgentDao agentDao, CapabilitySetManager capabilitySetManager, CapabilityManager capabilityManager, com.atlassian.event.api.EventPublisher eventPublisher, BambooLicenseManager bambooLicenseManager, ElasticInstanceManager elasticInstanceManager, ErrorUpdateHandler errorUpdateHandler, BuildLoggerManager buildLoggerManager, FeatureManager featureManager, DeploymentsInProgressService deploymentsInProgressService, ElasticTunnelDefinitionDao elasticTunnelDefinitionDao, EphemeralAgentsService ephemeralAgentsService, EphemeralAgentExecutionService ephemeralAgentExecutionService, EphemeralAgentManagementLogger ephemeralAgentManagementLogger)
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description voidabandonBuild(@NotNull BuildAgent remoteAgent, boolean agentStartingUp)booleanallowNewElasticAgent()Allow an elastic agent to register and come online? Based on licensing restrictions.booleanallowNewElasticAgents(int numOfAgentsToCreate)Allow a specified number of elastic agents to register and come online? Based on licensing restrictions.booleanallowNewEphemeralAgent()Allow an ephemeral agent to register and come online? Based on licensing restrictions.booleanallowNewLocalAgent()Allow a local agent to come online? Based on licensing restrictions.booleanallowNewRemoteAgent()Allow a remote agent to register and come online? Based on licensing restrictions.booleanallowNewRemoteAgents(int numOfAgentsToCreate)Allow a specified number of remote agents to register and come online? Based on licensing restrictions.booleancheckPipelinesAreDisabled()voidcreateDefaultAgent()sets up a default local agent if no local agent existsvoidcreateLocalAgent(LocalAgentDefinition definition)Create a new local agent.voiddisableAllAgents()Disable all pipelinesvoidenableAllAgents()Enable all pipelines<T> TexecuteIfIdle(Callable<T> callable)Executes a givenCallableonly if no builds are in progress.Map<Long,PipelineDefinition>findAllAgentsForAgentIds(@NotNull Collection<Long> agentIds)Returns a Map ofPipelineDefinitions keyed by their id@NotNull Collection<BuildAgent>getActiveAndEnabledAgents()Returns agents that are enabled and online@Nullable BuildAgentgetAgent(long agentId)longgetAgentCount(Class<? extends PipelineDefinition> agentDefinitionClass)Retrieves the amount of agents of given type stored in the database@Nullable PipelineDefinitiongetAgentDefinition(@NotNull Long agentId)@Nullable PipelineDefinitiongetAgentDefinitionByName(@NotNull String name)Retrieve a pipelineDefinition by name.@NotNull List<PipelineDefinition>getAgentDefinitionsWithNameLike(@NotNull String likeName)Return a list of agents whose name is like the provided string.@NotNull List<BuildAgent>getAllAgents()@NotNull List<ElasticAgentDefinition>getAllElasticAgentDefinitions(int firstResult, int maxResults)Retrieve most recently terminated elastic agent definitions from db, ordered by termination time, descending.@NotNull List<ElasticAgentDefinition>getAllElasticAgentDefinitions(@NotNull Collection<String> instanceIds)Retrieve elastic agent definitions from db.@NotNull List<LocalBuildAgent>getAllLocalAgents()Returns allLocalBuildAgentobjects@NotNull List<BuildAgent>getAllNonElasticAgents()List<PipelineDefinition>getAllPersistedAgentDefinitions()Retrieves a list of all agent definitions stored in the database.@NotNull List<BuildAgent>getAllRemoteAgents()Gets all remote agents in the system.@NotNull List<BuildAgent>getAllRemoteAgents(boolean onlineOnly)Get remote agents.@NotNull List<BuildAgent>getAllStandardAgents()@NotNull Collection<BuildAgent>getBusyBuildAgents()Gets a collection agents that are currently building or cancelling a build@NotNull Collection<BuildAgent>getElasticActiveAndEnabledAgents()Returns elastic agents that are enabled and online@NotNull Optional<BuildAgent>getEphemeralAgentByPodName(@NotNull String podName)Returns aBuildAgentby given pod name (if exists).@NotNull List<EphemeralAgentPod>getEphemeralAgentPods()Returns a list of ephemeral agents related pods in any phase present in the connected cluster at the moment of request.@NotNull List<EphemeralAgentPod>getEventuallyConsistentEphemeralAgentPods()Returns a list of ephemeral agents related pods in any phase present in the connected cluster.@NotNull Collection<LocalBuildAgent>getLocalActiveAndEnabledAgents()Returns local agents that are enabled and onlineLocalBuildAgentgetLocalAgent(long pipelineId)Returns the pipeline that matches the passed id@NotNull List<BuildAgent>getOnlineElasticAgents()Retrieve all online elastic build agents.intgetPendingEphemeralAgentsEstimatedCount()Get estimated number of pending ephemeral agents.@NotNull Collection<BuildAgent>getRemoteActiveAndEnabledAgents()Returns remote agents that are enabled and onlinevoidinitAgents()Inits the local agents Must be ran before any other methods.voidonAgentReturning(@NotNull BuildAgent agent)Performs any other operations required when an agent goes offline, such as updating the status and shutdown time.voidremoveAgent(long agentId)Removes the passed agentvoidremoveEphemeralAgent(long agentId)Removes the agent if the ephemeral one with requested ID is found.voidsaveAnyPipeline(@NotNull PipelineDefinition pipelineDefinition)Stores a pipelinePipelineDefinitionof any type (elastic, local, remote) AgentConfigurationUpdateEvent is fired after the pipeline is savedvoidsaveAnyPipeline(@NotNull PipelineDefinition pipelineDefinition, @Nullable AgentConfigurationUpdatedEventFactory eventFactory)Stores a pipelinePipelineDefinitionof any type (elastic, local, remote)voidsaveElasticPipeline(@NotNull ElasticAgentDefinition elasticDefinition)Stores the elasticPipelineDefinitionvoidsaveEphemeralPipeline(@NotNull EphemeralAgentDefinition pipelineDefinition)Stores the ephemeralPipelineDefinitionvoidsavePipeline(@NotNull PipelineDefinition pipelineDefinition)Stores thePipelineDefinition.voidsavePipeline(@NotNull PipelineDefinition pipelineDefinition, @Nullable AgentConfigurationUpdatedEventFactory eventFactory)Stores thePipelineDefinition.voidsaveReturningElasticPipeline(@NotNull ElasticAgentDefinition elasticDefinition)Stores the elasticPipelineDefinitionof a returning elastic agent.Optional<BuildAgent>setAgentEnabled(long agentId, boolean enable)voidstartLocalAgents()Starts all currentLocalBuildAgentobjectsvoidstopAgent(@NotNull BuildAgent agent)Performs any other operations required when an agent goes offline, such as updating the status and shutdown time.voidstopEphemeralAgentByPodName(@NotNull String podName)Stops the ephemeral agent with requested pod name.voidstopLocalAgents()Stops allLocalBuildAgentbooleanupdateAgentStatusIfResultReturnPossibleAfterServerRestart(long agentId, ResultKey resultKey, String displayName, long deploymentResultId)Checks if agent is capable of 'surviving' a server restart, i.e.
-
-
-
Constructor Detail
-
AgentManagerImpl
public AgentManagerImpl(AgentDao agentDao, CapabilitySetManager capabilitySetManager, CapabilityManager capabilityManager, com.atlassian.event.api.EventPublisher eventPublisher, BambooLicenseManager bambooLicenseManager, ElasticInstanceManager elasticInstanceManager, ErrorUpdateHandler errorUpdateHandler, BuildLoggerManager buildLoggerManager, FeatureManager featureManager, DeploymentsInProgressService deploymentsInProgressService, ElasticTunnelDefinitionDao elasticTunnelDefinitionDao, EphemeralAgentsService ephemeralAgentsService, EphemeralAgentExecutionService ephemeralAgentExecutionService, EphemeralAgentManagementLogger ephemeralAgentManagementLogger)
-
-
Method Detail
-
createDefaultAgent
public void createDefaultAgent()
Description copied from interface:AgentManagersets up a default local agent if no local agent exists- Specified by:
createDefaultAgentin interfaceAgentManager
-
initAgents
public void initAgents()
Description copied from interface:AgentManagerInits the local agents Must be ran before any other methods.- Specified by:
initAgentsin interfaceAgentManager
-
startLocalAgents
public void startLocalAgents()
Description copied from interface:AgentManagerStarts all currentLocalBuildAgentobjects- Specified by:
startLocalAgentsin interfaceAgentManager
-
stopLocalAgents
public void stopLocalAgents()
Description copied from interface:AgentManagerStops allLocalBuildAgent- Specified by:
stopLocalAgentsin interfaceAgentManager
-
getAllLocalAgents
@NotNull public @NotNull List<LocalBuildAgent> getAllLocalAgents()
Description copied from interface:AgentManagerReturns allLocalBuildAgentobjects- Specified by:
getAllLocalAgentsin interfaceAgentManager- Returns:
- A copied collection of
LocalBuildAgentobjects, or an empty collection if none exists.
-
getOnlineElasticAgents
@NotNull public @NotNull List<BuildAgent> getOnlineElasticAgents()
Description copied from interface:AgentManagerRetrieve all online elastic build agents.- Specified by:
getOnlineElasticAgentsin interfaceAgentManager- Returns:
-
getAllElasticAgentDefinitions
@NotNull public @NotNull List<ElasticAgentDefinition> getAllElasticAgentDefinitions(int firstResult, int maxResults)
Description copied from interface:AgentManagerRetrieve most recently terminated elastic agent definitions from db, ordered by termination time, descending.- Specified by:
getAllElasticAgentDefinitionsin interfaceAgentManager- Returns:
- list of ElasticAgents
-
getAgentCount
public long getAgentCount(Class<? extends PipelineDefinition> agentDefinitionClass)
Description copied from interface:AgentManagerRetrieves the amount of agents of given type stored in the database- Specified by:
getAgentCountin interfaceAgentManager- Parameters:
agentDefinitionClass- agent type- Returns:
- amount of agents
-
getAllElasticAgentDefinitions
@NotNull public @NotNull List<ElasticAgentDefinition> getAllElasticAgentDefinitions(@NotNull @NotNull Collection<String> instanceIds)
Description copied from interface:AgentManagerRetrieve elastic agent definitions from db.- Specified by:
getAllElasticAgentDefinitionsin interfaceAgentManager- Parameters:
instanceIds- the instances ids on which the agents were running- Returns:
- list of ElasticAgents
-
getAllRemoteAgents
@NotNull public @NotNull List<BuildAgent> getAllRemoteAgents(boolean onlineOnly)
Description copied from interface:AgentManagerGet remote agents.- Specified by:
getAllRemoteAgentsin interfaceAgentManager- Parameters:
onlineOnly- - only return those agents which are online currently.- Returns:
-
getAllRemoteAgents
@NotNull public @NotNull List<BuildAgent> getAllRemoteAgents()
Description copied from interface:AgentManagerGets all remote agents in the system. They can be offline.- Specified by:
getAllRemoteAgentsin interfaceAgentManager- Returns:
- all remote agents.
-
getAllAgents
@NotNull public @NotNull List<BuildAgent> getAllAgents()
- Specified by:
getAllAgentsin interfaceAgentManager
-
getAllNonElasticAgents
@NotNull public @NotNull List<BuildAgent> getAllNonElasticAgents()
- Specified by:
getAllNonElasticAgentsin interfaceAgentManager
-
getAllStandardAgents
@NotNull public @NotNull List<BuildAgent> getAllStandardAgents()
- Specified by:
getAllStandardAgentsin interfaceAgentManager- Returns:
- all standard agents, i.e. not ephemeral and not elastic
-
getBusyBuildAgents
@NotNull public @NotNull Collection<BuildAgent> getBusyBuildAgents()
Description copied from interface:AgentManagerGets a collection agents that are currently building or cancelling a build- Specified by:
getBusyBuildAgentsin interfaceAgentManager- Returns:
- Collection of
BuildAgent
-
getActiveAndEnabledAgents
@NotNull public @NotNull Collection<BuildAgent> getActiveAndEnabledAgents()
Description copied from interface:AgentManagerReturns agents that are enabled and online- Specified by:
getActiveAndEnabledAgentsin interfaceAgentManager- Returns:
- Collection of
BuildAgent
-
getRemoteActiveAndEnabledAgents
@NotNull public @NotNull Collection<BuildAgent> getRemoteActiveAndEnabledAgents()
Description copied from interface:AgentManagerReturns remote agents that are enabled and online- Specified by:
getRemoteActiveAndEnabledAgentsin interfaceAgentManager- Returns:
- Collection of
BuildAgent
-
getElasticActiveAndEnabledAgents
@NotNull public @NotNull Collection<BuildAgent> getElasticActiveAndEnabledAgents()
Description copied from interface:AgentManagerReturns elastic agents that are enabled and online- Specified by:
getElasticActiveAndEnabledAgentsin interfaceAgentManager- Returns:
- Collection of
BuildAgent
-
getLocalActiveAndEnabledAgents
@NotNull public @NotNull Collection<LocalBuildAgent> getLocalActiveAndEnabledAgents()
Description copied from interface:AgentManagerReturns local agents that are enabled and online- Specified by:
getLocalActiveAndEnabledAgentsin interfaceAgentManager- Returns:
- Collection of
LocalBuildAgent
-
createLocalAgent
public void createLocalAgent(LocalAgentDefinition definition) throws BambooLicenseException
Description copied from interface:AgentManagerCreate a new local agent.- Specified by:
createLocalAgentin interfaceAgentManager- Throws:
BambooLicenseException
-
savePipeline
public void savePipeline(@NotNull @NotNull PipelineDefinition pipelineDefinition)Description copied from interface:AgentManagerStores thePipelineDefinition. Updates any caches so calls toAgentManager.getLocalAgent(long)will return theLocalBuildAgentreturns with the new definition- Specified by:
savePipelinein interfaceAgentManager- Parameters:
pipelineDefinition- - Must not be null
-
savePipeline
public void savePipeline(@NotNull @NotNull PipelineDefinition pipelineDefinition, @Nullable @Nullable AgentConfigurationUpdatedEventFactory eventFactory)Description copied from interface:AgentManagerStores thePipelineDefinition. Updates any caches so calls toAgentManager.getLocalAgent(long)will return theLocalBuildAgentreturns with the new definition- Specified by:
savePipelinein interfaceAgentManager- Parameters:
pipelineDefinition- - Must not be nulleventFactory- event factory used to create event sent after the pipeline is saved
-
saveElasticPipeline
public void saveElasticPipeline(@NotNull @NotNull ElasticAgentDefinition elasticDefinition)Description copied from interface:AgentManagerStores the elasticPipelineDefinition- Specified by:
saveElasticPipelinein interfaceAgentManager- Parameters:
elasticDefinition- - Must not be null
-
saveEphemeralPipeline
public void saveEphemeralPipeline(@NotNull @NotNull EphemeralAgentDefinition pipelineDefinition)Description copied from interface:AgentManagerStores the ephemeralPipelineDefinition- Specified by:
saveEphemeralPipelinein interfaceAgentManager- Parameters:
pipelineDefinition- - Must not be null
-
saveReturningElasticPipeline
public void saveReturningElasticPipeline(@NotNull @NotNull ElasticAgentDefinition elasticDefinition)Description copied from interface:AgentManagerStores the elasticPipelineDefinitionof a returning elastic agent.- Specified by:
saveReturningElasticPipelinein interfaceAgentManager- Parameters:
elasticDefinition- returning elastic agent definition
-
getAllPersistedAgentDefinitions
public List<PipelineDefinition> getAllPersistedAgentDefinitions()
Description copied from interface:AgentManagerRetrieves a list of all agent definitions stored in the database.- Specified by:
getAllPersistedAgentDefinitionsin interfaceAgentManager
-
abandonBuild
public void abandonBuild(@NotNull @NotNull BuildAgent remoteAgent, boolean agentStartingUp)- Specified by:
abandonBuildin interfaceAgentManager
-
onAgentReturning
public void onAgentReturning(@NotNull @NotNull BuildAgent agent)Description copied from interface:AgentManagerPerforms any other operations required when an agent goes offline, such as updating the status and shutdown time. Called when agent re-registered without being marked as offline.- Specified by:
onAgentReturningin interfaceAgentManager- Parameters:
agent- to be stopped
-
stopAgent
public void stopAgent(@NotNull @NotNull BuildAgent agent)Description copied from interface:AgentManagerPerforms any other operations required when an agent goes offline, such as updating the status and shutdown time.- Specified by:
stopAgentin interfaceAgentManager- Parameters:
agent- to be stopped
-
getLocalAgent
public LocalBuildAgent getLocalAgent(long pipelineId)
Description copied from interface:AgentManagerReturns the pipeline that matches the passed id- Specified by:
getLocalAgentin interfaceAgentManager- Returns:
- Matching
LocalBuildAgentobject. Null if pipeline does not exist
-
getAgent
@Nullable public @Nullable BuildAgent getAgent(long agentId)
- Specified by:
getAgentin interfaceAgentManager
-
getAgentDefinition
@Nullable public @Nullable PipelineDefinition getAgentDefinition(@NotNull @NotNull Long agentId)
- Specified by:
getAgentDefinitionin interfaceAgentManager
-
getEphemeralAgentPods
@NotNull public @NotNull List<EphemeralAgentPod> getEphemeralAgentPods()
Description copied from interface:AgentManagerReturns a list of ephemeral agents related pods in any phase present in the connected cluster at the moment of request.- Specified by:
getEphemeralAgentPodsin interfaceAgentManager- Returns:
- a List of
EphemeralAgentPod
-
getEventuallyConsistentEphemeralAgentPods
@NotNull public @NotNull List<EphemeralAgentPod> getEventuallyConsistentEphemeralAgentPods()
Description copied from interface:AgentManagerReturns a list of ephemeral agents related pods in any phase present in the connected cluster. The results may be stale. The desired order of magnitude of delay is seconds.- Specified by:
getEventuallyConsistentEphemeralAgentPodsin interfaceAgentManager- Returns:
- a List of
EphemeralAgentPod
-
getPendingEphemeralAgentsEstimatedCount
public int getPendingEphemeralAgentsEstimatedCount()
Description copied from interface:AgentManagerGet estimated number of pending ephemeral agents.- Specified by:
getPendingEphemeralAgentsEstimatedCountin interfaceAgentManager
-
getEphemeralAgentByPodName
@NotNull public @NotNull Optional<BuildAgent> getEphemeralAgentByPodName(@NotNull @NotNull String podName)
Description copied from interface:AgentManagerReturns aBuildAgentby given pod name (if exists).- Specified by:
getEphemeralAgentByPodNamein interfaceAgentManager
-
stopEphemeralAgentByPodName
public void stopEphemeralAgentByPodName(@NotNull @NotNull String podName)Description copied from interface:AgentManagerStops the ephemeral agent with requested pod name.- Specified by:
stopEphemeralAgentByPodNamein interfaceAgentManager- Parameters:
podName- name of the pod the ephemeral agent is running on
-
findAllAgentsForAgentIds
public Map<Long,PipelineDefinition> findAllAgentsForAgentIds(@NotNull @NotNull Collection<Long> agentIds)
Description copied from interface:AgentManagerReturns a Map ofPipelineDefinitions keyed by their id- Specified by:
findAllAgentsForAgentIdsin interfaceAgentManager- Returns:
- agentMap
-
getAgentDefinitionByName
@Nullable public @Nullable PipelineDefinition getAgentDefinitionByName(@NotNull @NotNull String name)
Description copied from interface:AgentManagerRetrieve a pipelineDefinition by name. Names should be unique.- Specified by:
getAgentDefinitionByNamein interfaceAgentManager- Parameters:
name- of the agent to find- Returns:
- the agent that has the given name.
-
getAgentDefinitionsWithNameLike
@NotNull public @NotNull List<PipelineDefinition> getAgentDefinitionsWithNameLike(@NotNull @NotNull String likeName)
Description copied from interface:AgentManagerReturn a list of agents whose name is like the provided string. Uses hibernate's "like" so % to mark wild card.- Specified by:
getAgentDefinitionsWithNameLikein interfaceAgentManager- Parameters:
likeName- the string to match- Returns:
- List of Pipeline Definitions
-
saveAnyPipeline
public void saveAnyPipeline(@NotNull @NotNull PipelineDefinition pipelineDefinition)Description copied from interface:AgentManagerStores a pipelinePipelineDefinitionof any type (elastic, local, remote) AgentConfigurationUpdateEvent is fired after the pipeline is saved- Specified by:
saveAnyPipelinein interfaceAgentManager- Parameters:
pipelineDefinition- - Must not be null
-
saveAnyPipeline
public void saveAnyPipeline(@NotNull @NotNull PipelineDefinition pipelineDefinition, @Nullable @Nullable AgentConfigurationUpdatedEventFactory eventFactory)Description copied from interface:AgentManagerStores a pipelinePipelineDefinitionof any type (elastic, local, remote)- Specified by:
saveAnyPipelinein interfaceAgentManager- Parameters:
pipelineDefinition- Must not be nulleventFactory- event factory used to create event sent after the pipeline is saved
-
disableAllAgents
public void disableAllAgents()
Description copied from interface:AgentManagerDisable all pipelines- Specified by:
disableAllAgentsin interfaceAgentManager
-
enableAllAgents
public void enableAllAgents()
Description copied from interface:AgentManagerEnable all pipelines- Specified by:
enableAllAgentsin interfaceAgentManager
-
checkPipelinesAreDisabled
public boolean checkPipelinesAreDisabled()
- Specified by:
checkPipelinesAreDisabledin interfaceAgentManager- Returns:
- whether or not all pipelines are disabled
-
executeIfIdle
public <T> T executeIfIdle(Callable<T> callable) throws Exception
Description copied from interface:AgentManagerExecutes a given
Callableonly if no builds are in progress. Builds are prevented from starting while theCallableexecutes.- Specified by:
executeIfIdlein interfaceAgentManager- Parameters:
callable- theCallableto be executed- Returns:
- the result of
callable - Throws:
BambooBusyException- if builds are in progressException- if thrown bycallable
-
removeAgent
public void removeAgent(long agentId) throws TimeoutExceptionDescription copied from interface:AgentManagerRemoves the passed agent- Specified by:
removeAgentin interfaceAgentManager- Throws:
TimeoutException
-
removeEphemeralAgent
public void removeEphemeralAgent(long agentId)
Description copied from interface:AgentManagerRemoves the agent if the ephemeral one with requested ID is found. If the agent is not ephemeral - nothing happens.- Specified by:
removeEphemeralAgentin interfaceAgentManager- Parameters:
agentId- agent unique identifier
-
allowNewRemoteAgent
public boolean allowNewRemoteAgent()
Description copied from interface:AgentManagerAllow a remote agent to register and come online? Based on licensing restrictions. The method takes into consideration the number of agents "reserved" for pending elastic instances.- Specified by:
allowNewRemoteAgentin interfaceAgentManager- Returns:
- true if a new agent is allowed, otherise false
-
allowNewRemoteAgents
public boolean allowNewRemoteAgents(int numOfAgentsToCreate)
Description copied from interface:AgentManagerAllow a specified number of remote agents to register and come online? Based on licensing restrictions. The method takes into consideration the number of agents "reserved" for pending elastic instances.- Specified by:
allowNewRemoteAgentsin interfaceAgentManager- Returns:
- true if a specified number agents is allowed, otherise false
-
allowNewElasticAgent
public boolean allowNewElasticAgent()
Description copied from interface:AgentManagerAllow an elastic agent to register and come online? Based on licensing restrictions.- Specified by:
allowNewElasticAgentin interfaceAgentManager- Returns:
- true if a new agent is allowed, otherise false
-
allowNewEphemeralAgent
public boolean allowNewEphemeralAgent()
Description copied from interface:AgentManagerAllow an ephemeral agent to register and come online? Based on licensing restrictions.- Specified by:
allowNewEphemeralAgentin interfaceAgentManager- Returns:
- true if a new agent is allowed, otherise false
-
allowNewElasticAgents
public boolean allowNewElasticAgents(int numOfAgentsToCreate)
Description copied from interface:AgentManagerAllow a specified number of elastic agents to register and come online? Based on licensing restrictions.- Specified by:
allowNewElasticAgentsin interfaceAgentManager- Returns:
- true if a specified number agents is allowed, otherise false
-
allowNewLocalAgent
public boolean allowNewLocalAgent()
Description copied from interface:AgentManagerAllow a local agent to come online? Based on licensing restrictions.- Specified by:
allowNewLocalAgentin interfaceAgentManager- Returns:
- true if a new local agent is allowed, otherwise false
-
updateAgentStatusIfResultReturnPossibleAfterServerRestart
public boolean updateAgentStatusIfResultReturnPossibleAfterServerRestart(long agentId, ResultKey resultKey, String displayName, long deploymentResultId)Description copied from interface:AgentManagerChecks if agent is capable of 'surviving' a server restart, i.e. if agent exists and is configured to reconnect after server restart, allowing it to return build result produced while the server was down. Sets agent status to 'building' if it is so.- Specified by:
updateAgentStatusIfResultReturnPossibleAfterServerRestartin interfaceAgentManager- Returns:
- true iff agents is capable of surviving a server restart.
-
setAgentEnabled
public Optional<BuildAgent> setAgentEnabled(long agentId, boolean enable)
- Specified by:
setAgentEnabledin interfaceAgentManager
-
-