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
ConstructorsConstructorDescriptionRemoteAgentManagerImpl(int heartbeatTimeoutSeconds, StartupStatisticsBean startupStatisticsBean, com.atlassian.event.api.EventPublisher eventPublisher) -
Method Summary
Modifier and TypeMethodDescriptionvoidaddRemoteAgentLogEntry(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.voidRuns a check for offline remote agents.voidinit()Initialize the state of the component.booleanChecks 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.voidvoidstart()voidvoidstopRemoteAgent(@NotNull BuildAgent agent) updateRemoteAgentStatus(@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 Details
-
RemoteAgentManagerImpl
public RemoteAgentManagerImpl(int heartbeatTimeoutSeconds, StartupStatisticsBean startupStatisticsBean, com.atlassian.event.api.EventPublisher eventPublisher)
-
-
Method Details
-
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
Description 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
- Specified by:
stopRemoteAgentin interfaceRemoteAgentManager
-
bootstrapping
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
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
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
- Specified by:
addRemoteAgentLogEntryin interfaceRemoteAgentManager
-
stopConnectors
- Specified by:
stopConnectorsin interfaceRemoteAgentManager- Throws:
Exception
-
start
- Specified by:
startin interfaceRemoteAgentManager- Throws:
Exception
-
getRemoteAgentLog
- Specified by:
getRemoteAgentLogin interfaceRemoteAgentManager
-
setHeartbeatCheckInterval
public void setHeartbeatCheckInterval(int heartbeatCheckInterval) -
setHeartbeatInterval
public void setHeartbeatInterval(int heartbeatInterval) -
setUri
-