Class RemoteAgentManagerImpl
- java.lang.Object
-
- com.atlassian.bamboo.buildqueue.manager.RemoteAgentManagerImpl
-
- All Implemented Interfaces:
RemoteAgentManager,RemotedRemoteAgentManager,DelayedStateInitialization
public class RemoteAgentManagerImpl extends Object implements RemoteAgentManager, DelayedStateInitialization
-
-
Constructor Summary
Constructors Constructor Description RemoteAgentManagerImpl(int heartbeatTimeoutSeconds, StartupStatisticsBean startupStatisticsBean, com.atlassian.event.api.EventPublisher eventPublisher)
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description voidaddRemoteAgentLogEntry(String logEntry)voidbootstrapping(String agentHostName)Notifies theRemoteAgentManagerthat a remote agent has commenced bootstrapping.voidbootstrappingElastic(String agentHostName, @Nullable String instanceId)Notifies theRemoteAgentManagerthat an elastic agent has commenced bootstrapping.voidbootstrappingEphemeral(String agentHostName)Notifies theRemoteAgentManagerthat an ephemeral agent has commenced bootstrapping.voidcheckOfflineAgents()Runs a check for offline remote agents.List<String>getRemoteAgentLog()voidinit()Initialize the state of the component.booleanisRemoteAgentFunctionEnabled()Checks whether the remote agent functionality is currently enabled.@NotNull PipelineDefinitionregisterAgent(@NotNull PipelineDefinition remoteAgentDefinition)Initial setup / verification of the agent.@NotNull RemotableRemoteAgentDefinitionregisterAgent(@NotNull RemotableRemoteAgentDefinition remotableRemoteAgentDefinition)Initial setup / verification of the agent.voidsetHeartbeatCheckInterval(int heartbeatCheckInterval)voidsetHeartbeatInterval(int heartbeatInterval)voidsetRemoteAgentFunctionEnabled(boolean remoteAgentFunctionEnabled)Controls whether the remote agent functionality of Bamboo is enabled.voidsetUri(String uri)voidstart()voidstopConnectors()voidstopRemoteAgent(@NotNull BuildAgent agent)AgentHeartBeatInfoupdateRemoteAgentStatus(@NotNull Long agentId, @Nullable UUID uuid, @NotNull AgentStatus newStatus, @NotNull SystemInfo systemInfo)Updates theBuildAgent's status representing a remote agent on the local server.
-
-
-
Constructor Detail
-
RemoteAgentManagerImpl
public RemoteAgentManagerImpl(int heartbeatTimeoutSeconds, StartupStatisticsBean startupStatisticsBean, com.atlassian.event.api.EventPublisher eventPublisher)
-
-
Method Detail
-
init
public void init()
Description copied from interface:DelayedStateInitializationInitialize the state of the component.- Specified by:
initin interfaceDelayedStateInitialization
-
registerAgent
@NotNull public @NotNull RemotableRemoteAgentDefinition registerAgent(@NotNull @NotNull RemotableRemoteAgentDefinition remotableRemoteAgentDefinition)
Description copied from interface:RemotedRemoteAgentManagerInitial setup / verification of the agent. This method may perform checking of whether the remote agent matches the current version on the server / updates etc- Specified by:
registerAgentin interfaceRemotedRemoteAgentManager- Parameters:
remotableRemoteAgentDefinition- - id may be -1 if the build is new- Returns:
- RemoteAgentDefinition with the id filled
-
registerAgent
@NotNull public @NotNull PipelineDefinition registerAgent(@NotNull @NotNull PipelineDefinition remoteAgentDefinition) throws BambooLicenseException
Description copied from interface:RemoteAgentManagerInitial setup / verification of the agent. This method may perform checking of whether the remote agent matches the current version on the server / updates etc- Specified by:
registerAgentin interfaceRemoteAgentManager- Parameters:
remoteAgentDefinition- - id may be -1 if the build is new- Returns:
- RemoteAgentDefinition with the id filled
- Throws:
BambooLicenseException
-
updateRemoteAgentStatus
public AgentHeartBeatInfo updateRemoteAgentStatus(@NotNull @NotNull Long agentId, @Nullable @Nullable UUID uuid, @NotNull @NotNull AgentStatus newStatus, @NotNull @NotNull SystemInfo systemInfo)
Description copied from interface:RemoteAgentManagerUpdates theBuildAgent's status representing a remote agent on the local server.- Specified by:
updateRemoteAgentStatusin interfaceRemoteAgentManager- Parameters:
agentId- ID of the agentuuid- UUID of the agentnewStatus- agent statussystemInfo- agent system info- Returns:
- current heart beat info
-
checkOfflineAgents
public void checkOfflineAgents()
Description copied from interface:RemoteAgentManagerRuns a check for offline remote agents.- Specified by:
checkOfflineAgentsin interfaceRemoteAgentManager
-
setRemoteAgentFunctionEnabled
public void setRemoteAgentFunctionEnabled(boolean remoteAgentFunctionEnabled) throws ExceptionDescription copied from interface:RemoteAgentManagerControls whether the remote agent functionality of Bamboo is enabled.
- Specified by:
setRemoteAgentFunctionEnabledin interfaceRemoteAgentManager- Parameters:
remoteAgentFunctionEnabled-trueif remote agent functionality should be enabled;falseotherwise.- Throws:
Exception- on any error
-
isRemoteAgentFunctionEnabled
public boolean isRemoteAgentFunctionEnabled()
Description copied from interface:RemoteAgentManagerChecks whether the remote agent functionality is currently enabled.- Specified by:
isRemoteAgentFunctionEnabledin interfaceRemoteAgentManager- Returns:
true, if remote agent functionality is enabled,falseotherwise
-
stopRemoteAgent
public void stopRemoteAgent(@NotNull @NotNull BuildAgent agent)- Specified by:
stopRemoteAgentin interfaceRemoteAgentManager
-
bootstrapping
public void bootstrapping(String agentHostName)
Description copied from interface:RemoteAgentManagerNotifies the
RemoteAgentManagerthat a remote agent has commenced bootstrapping.- Specified by:
bootstrappingin interfaceRemoteAgentManager- Parameters:
agentHostName- The host name or IP address of the host on which the remote agent is running.nullif unknown.
-
bootstrappingEphemeral
public void bootstrappingEphemeral(String agentHostName)
Description copied from interface:RemoteAgentManagerNotifies the
RemoteAgentManagerthat an ephemeral agent has commenced bootstrapping.- Specified by:
bootstrappingEphemeralin interfaceRemoteAgentManager- Parameters:
agentHostName- The host name or IP address of the host on which the remote agent is running.nullif unknown.
-
bootstrappingElastic
public void bootstrappingElastic(String agentHostName, @Nullable @Nullable String instanceId)
Description copied from interface:RemoteAgentManagerNotifies the
RemoteAgentManagerthat an elastic agent has commenced bootstrapping.- Specified by:
bootstrappingElasticin interfaceRemoteAgentManager- Parameters:
agentHostName- The host name or IP address of the host on which the remote agent is running.nullif unknown.instanceId- the instance the elastic agent is loading on
-
addRemoteAgentLogEntry
public void addRemoteAgentLogEntry(String logEntry)
- Specified by:
addRemoteAgentLogEntryin interfaceRemoteAgentManager
-
stopConnectors
public void stopConnectors() throws Exception- Specified by:
stopConnectorsin interfaceRemoteAgentManager- Throws:
Exception
-
start
public void start() throws Exception- Specified by:
startin interfaceRemoteAgentManager- Throws:
Exception
-
getRemoteAgentLog
public List<String> getRemoteAgentLog()
- Specified by:
getRemoteAgentLogin interfaceRemoteAgentManager
-
setHeartbeatCheckInterval
public void setHeartbeatCheckInterval(int heartbeatCheckInterval)
-
setHeartbeatInterval
public void setHeartbeatInterval(int heartbeatInterval)
-
setUri
public void setUri(String uri)
-
-