Class AgentManagerImpl
java.lang.Object
com.atlassian.bamboo.buildqueue.manager.AgentManagerImpl
- All Implemented Interfaces:
AgentManager,LocalAgentManager
-
Field Summary
Fields inherited from interface com.atlassian.bamboo.buildqueue.manager.AgentManager
DEFAULT_AGENT_NAME -
Constructor Summary
ConstructorsConstructorDescriptionAgentManagerImpl(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
Modifier and TypeMethodDescriptionvoidabandonBuild(@NotNull BuildAgent remoteAgent, boolean agentStartingUp) booleanAllow an elastic agent to register and come online?booleanallowNewElasticAgents(int numOfAgentsToCreate) Allow a specified number of elastic agents to register and come online?booleanallowNewElasticAgentWithId(long id) Allow an elastic agent with specific id to register and come online?booleanAllow an ephemeral agent to register and come online?booleanallowNewEphemeralAgentWithId(long id) Allow an ephemeral agent with specific id to register and come online?booleanAllow a local agent to come online?booleanAllow a remote agent to register and come online?booleanallowNewRemoteAgents(int numOfAgentsToCreate) Allow a specified number of remote agents to register and come online?booleanallowNewRemoteAgentWithId(long id) Allow a remote agent with specific id to register and come online?booleanvoidsets up a default local agent if no local agent existsvoidcreateLocalAgent(LocalAgentDefinition definition) Create a new local agent.voidDisable all pipelinesvoidEnable all pipelinesfindAllAgentsForAgentIds(@NotNull Collection<Long> agentIds) Returns a Map ofPipelineDefinitions keyed by their id@NotNull Collection<BuildAgent> 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 aPipelineDefinitionby name.@NotNull List<PipelineDefinition> getAgentDefinitionsByName(@NotNull String name) RetrievePipelineDefinitions by name.@NotNull List<PipelineDefinition> getAgentDefinitionsWithNameLike(@NotNull String likeName) Return a list of agents whose name is like the provided string.@NotNull List<BuildAgent> @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> Returns allLocalBuildAgentobjects@NotNull List<BuildAgent> Retrieves a list of all agent definitions stored in the database.@NotNull List<BuildAgent> Gets all remote agents in the system.@NotNull List<BuildAgent> getAllRemoteAgents(boolean onlineOnly) Get remote agents.intgetAllRemoteAgentsCount(boolean onlineOnly) Get remote agents count.@NotNull List<BuildAgent> @NotNull Collection<BuildAgent> Gets a collection agents that are currently building or cancelling a build@NotNull Collection<BuildAgent> 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> Returns a list of ephemeral agents related pods in any phase present in the connected cluster at the moment of request.@NotNull List<EphemeralAgentPod> Returns a list of ephemeral agents related pods in any phase present in the connected cluster.@NotNull Collection<LocalBuildAgent> Returns local agents that are enabled and onlinegetLocalAgent(long pipelineId) Returns the pipeline that matches the passed idlonggetOfflineAgentCount(Class<? extends PipelineDefinition> agentDefinitionClass) Retrieves the amount of offline agents of given type stored in the database@NotNull List<ElasticAgentDefinition> getOfflineElasticAgentDefinitions(int firstResult, int maxResults) Retrieve offline elastic agents.Retrieves a list of offline elastic agents IDs.Retrieves a list of offline ephemeral agents IDs.Retrieves a list of offline remote agent IDs.@NotNull List<BuildAgent> Retrieve all online elastic build agents.intRetrieves the total count of online ephemeral agents currently present in the system.intGet estimated number of pending ephemeral agents.@NotNull Collection<BuildAgent> Returns remote agents that are enabled and onlinevoidInits 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 agent (any type)voidremoveEphemeralAgent(long agentId) Removes the agent if the ephemeral one with requested ID is found.voidremoveRemoteAgent(long agentId) Removes a remote agentvoidsaveAnyPipeline(@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.setAgentEnabled(long agentId, boolean enable) voidStarts 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.voidStops allLocalBuildAgentbooleanupdateAgentStatusIfResultReturnPossibleAfterServerRestart(long agentId, ResultKey resultKey, String displayName, long deploymentResultId) Checks 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.
-
Constructor Details
-
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 Details
-
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
Description copied from interface:AgentManagerReturns allLocalBuildAgentobjects- Specified by:
getAllLocalAgentsin interfaceAgentManager- Returns:
- A copied collection of
LocalBuildAgentobjects, or an empty collection if none exists.
-
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
-
getOfflineElasticAgentDefinitions
@NotNull public @NotNull List<ElasticAgentDefinition> getOfflineElasticAgentDefinitions(int firstResult, int maxResults) Description copied from interface:AgentManagerRetrieve offline elastic agents.- Specified by:
getOfflineElasticAgentDefinitionsin interfaceAgentManager- Returns:
- list of ElasticAgents
-
getAgentCount
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
-
getOfflineAgentCount
Description copied from interface:AgentManagerRetrieves the amount of offline agents of given type stored in the database- Specified by:
getOfflineAgentCountin 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
Description copied from interface:AgentManagerGet remote agents.- Specified by:
getAllRemoteAgentsin interfaceAgentManager- Parameters:
onlineOnly- - only return those agents which are online currently.- Returns:
- list of agents
-
getAllRemoteAgentsCount
public int getAllRemoteAgentsCount(boolean onlineOnly) Description copied from interface:AgentManagerGet remote agents count.- Specified by:
getAllRemoteAgentsCountin interfaceAgentManager- Parameters:
onlineOnly- - only return those agents which are online currently.
-
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
- Specified by:
getAllAgentsin interfaceAgentManager
-
getAllNonElasticAgents
- Specified by:
getAllNonElasticAgentsin interfaceAgentManager
-
getAllStandardAgents
- Specified by:
getAllStandardAgentsin interfaceAgentManager- Returns:
- all standard agents, i.e. not ephemeral and not elastic
-
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
Description copied from interface:AgentManagerReturns agents that are enabled and online- Specified by:
getActiveAndEnabledAgentsin interfaceAgentManager- Returns:
- Collection of
BuildAgent
-
getRemoteActiveAndEnabledAgents
Description copied from interface:AgentManagerReturns remote agents that are enabled and online- Specified by:
getRemoteActiveAndEnabledAgentsin interfaceAgentManager- Returns:
- Collection of
BuildAgent
-
getElasticActiveAndEnabledAgents
Description copied from interface:AgentManagerReturns elastic agents that are enabled and online- Specified by:
getElasticActiveAndEnabledAgentsin interfaceAgentManager- Returns:
- Collection of
BuildAgent
-
getLocalActiveAndEnabledAgents
Description copied from interface:AgentManagerReturns local agents that are enabled and online- Specified by:
getLocalActiveAndEnabledAgentsin interfaceAgentManager- Returns:
- Collection of
LocalBuildAgent
-
createLocalAgent
Description copied from interface:AgentManagerCreate a new local agent.- Specified by:
createLocalAgentin interfaceAgentManager- Parameters:
definition-- Throws:
BambooLicenseException
-
savePipeline
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
Description copied from interface:AgentManagerStores the elasticPipelineDefinition- Specified by:
saveElasticPipelinein interfaceAgentManager- Parameters:
elasticDefinition- - Must not be null
-
saveEphemeralPipeline
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
Description copied from interface:AgentManagerRetrieves a list of all agent definitions stored in the database.- Specified by:
getAllPersistedAgentDefinitionsin interfaceAgentManager
-
abandonBuild
- Specified by:
abandonBuildin interfaceAgentManager
-
onAgentReturning
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
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
Description copied from interface:AgentManagerReturns the pipeline that matches the passed id- Specified by:
getLocalAgentin interfaceAgentManager- Parameters:
pipelineId-- Returns:
- Matching
LocalBuildAgentobject. Null if pipeline does not exist
-
getAgent
- Specified by:
getAgentin interfaceAgentManager
-
getAgentDefinition
- Specified by:
getAgentDefinitionin interfaceAgentManager
-
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
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
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- Parameters:
agentIds-- Returns:
- agentMap
-
getAgentDefinitionByName
@Nullable public @Nullable PipelineDefinition getAgentDefinitionByName(@NotNull @NotNull String name) Description copied from interface:AgentManagerRetrieve aPipelineDefinitionby name. Names should be unique.- Specified by:
getAgentDefinitionByNamein interfaceAgentManager- Parameters:
name- of the agent to find- Returns:
- the agent that has the given name.
-
getAgentDefinitionsByName
@NotNull public @NotNull List<PipelineDefinition> getAgentDefinitionsByName(@NotNull @NotNull String name) Description copied from interface:AgentManagerRetrievePipelineDefinitions by name. Names should be unique. However, duplicates are possible due to not properly handled unsuccessful registration attempts.- Specified by:
getAgentDefinitionsByNamein 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
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
-
removeAgent
Description copied from interface:AgentManagerRemoves the passed agent (any type)- Specified by:
removeAgentin interfaceAgentManager- Parameters:
agentId-- Throws:
TimeoutException
-
removeRemoteAgent
public void removeRemoteAgent(long agentId) Description copied from interface:AgentManagerRemoves a remote agent- Specified by:
removeRemoteAgentin interfaceAgentManager
-
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
-
allowNewRemoteAgentWithId
public boolean allowNewRemoteAgentWithId(long id) Description copied from interface:AgentManagerAllow a remote agent with specific id 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:
allowNewRemoteAgentWithIdin interfaceAgentManager- Parameters:
id- agent id- 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
-
allowNewElasticAgentWithId
public boolean allowNewElasticAgentWithId(long id) Description copied from interface:AgentManagerAllow an elastic agent with specific id to register and come online? Based on licensing restrictions.- Specified by:
allowNewElasticAgentWithIdin interfaceAgentManager- Parameters:
id- agent id- 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
-
allowNewEphemeralAgentWithId
public boolean allowNewEphemeralAgentWithId(long id) Description copied from interface:AgentManagerAllow an ephemeral agent with specific id to register and come online? Based on licensing restrictions.- Specified by:
allowNewEphemeralAgentWithIdin interfaceAgentManager- Parameters:
id- agent id- 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
- Specified by:
setAgentEnabledin interfaceAgentManager
-
getOfflineRemoteAgentIds
Description copied from interface:AgentManagerRetrieves a list of offline remote agent IDs. Offline remote agents are those that are not currently connected to the server.- Specified by:
getOfflineRemoteAgentIdsin interfaceAgentManager- Returns:
- a list of offline remote agents IDs
-
getOfflineElasticAgentIds
Description copied from interface:AgentManagerRetrieves a list of offline elastic agents IDs. Offline elastic agents are those that are not currently connected to the server.- Specified by:
getOfflineElasticAgentIdsin interfaceAgentManager- Returns:
- a list of offline elastic agents IDs
-
getOfflineEphemeralAgentIds
Description copied from interface:AgentManagerRetrieves a list of offline ephemeral agents IDs. Offline ephemeral agents are those that are not currently connected to the server. As ephemeral agents take care of the self-removal once they finish executing the executable they were launched for, this should return only a small portion of agents that couldn't be removed due to errors or temporary unavailability.- Specified by:
getOfflineEphemeralAgentIdsin interfaceAgentManager- Returns:
- a list of offline ephemeral agents IDs
-
getOnlineEphemeralAgentCount
public int getOnlineEphemeralAgentCount()Description copied from interface:AgentManagerRetrieves the total count of online ephemeral agents currently present in the system. Ephemeral agents are temporary agents that are created for specific tasks and are typically removed after completing their execution.- Specified by:
getOnlineEphemeralAgentCountin interfaceAgentManager- Returns:
- the total number of ephemeral agents
-