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
ConstructorDescriptionRemoteAgentManagerImpl
(int heartbeatTimeoutSeconds, StartupStatisticsBean startupStatisticsBean, com.atlassian.event.api.EventPublisher eventPublisher) -
Method Summary
Modifier and TypeMethodDescriptionvoid
addRemoteAgentLogEntry
(String logEntry) void
bootstrapping
(String agentHostName) Notifies theRemoteAgentManager
that a remote agent has commenced bootstrapping.void
bootstrappingElastic
(String agentHostName, @Nullable String instanceId) Notifies theRemoteAgentManager
that an elastic agent has commenced bootstrapping.void
bootstrappingEphemeral
(String agentHostName) Notifies theRemoteAgentManager
that an ephemeral agent has commenced bootstrapping.void
Runs a check for offline remote agents.void
init()
Initialize the state of the component.boolean
Checks whether the remote agent functionality is currently enabled.@NotNull PipelineDefinition
registerAgent
(@NotNull PipelineDefinition remoteAgentDefinition) Initial setup / verification of the agent.@NotNull RemotableRemoteAgentDefinition
registerAgent
(@NotNull RemotableRemoteAgentDefinition remotableRemoteAgentDefinition) Initial setup / verification of the agent.void
setHeartbeatCheckInterval
(int heartbeatCheckInterval) void
setHeartbeatInterval
(int heartbeatInterval) void
setRemoteAgentFunctionEnabled
(boolean remoteAgentFunctionEnabled) Controls whether the remote agent functionality of Bamboo is enabled.void
void
start()
void
void
stopRemoteAgent
(@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:DelayedStateInitialization
Initialize the state of the component.- Specified by:
init
in interfaceDelayedStateInitialization
-
registerAgent
@NotNull public @NotNull RemotableRemoteAgentDefinition registerAgent(@NotNull @NotNull RemotableRemoteAgentDefinition remotableRemoteAgentDefinition) Description copied from interface:RemotedRemoteAgentManager
Initial 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:
registerAgent
in 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:RemoteAgentManager
Initial 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:
registerAgent
in 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:RemoteAgentManager
Updates theBuildAgent
's status representing a remote agent on the local server.- Specified by:
updateRemoteAgentStatus
in 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:RemoteAgentManager
Runs a check for offline remote agents.- Specified by:
checkOfflineAgents
in interfaceRemoteAgentManager
-
setRemoteAgentFunctionEnabled
Description copied from interface:RemoteAgentManager
Controls whether the remote agent functionality of Bamboo is enabled.
- Specified by:
setRemoteAgentFunctionEnabled
in interfaceRemoteAgentManager
- Parameters:
remoteAgentFunctionEnabled
-true
if remote agent functionality should be enabled;false
otherwise.- Throws:
Exception
- on any error
-
isRemoteAgentFunctionEnabled
public boolean isRemoteAgentFunctionEnabled()Description copied from interface:RemoteAgentManager
Checks whether the remote agent functionality is currently enabled.- Specified by:
isRemoteAgentFunctionEnabled
in interfaceRemoteAgentManager
- Returns:
true
, if remote agent functionality is enabled,false
otherwise
-
stopRemoteAgent
- Specified by:
stopRemoteAgent
in interfaceRemoteAgentManager
-
bootstrapping
Description copied from interface:RemoteAgentManager
Notifies the
RemoteAgentManager
that a remote agent has commenced bootstrapping.- Specified by:
bootstrapping
in interfaceRemoteAgentManager
- Parameters:
agentHostName
- The host name or IP address of the host on which the remote agent is running.null
if unknown.
-
bootstrappingEphemeral
Description copied from interface:RemoteAgentManager
Notifies the
RemoteAgentManager
that an ephemeral agent has commenced bootstrapping.- Specified by:
bootstrappingEphemeral
in interfaceRemoteAgentManager
- Parameters:
agentHostName
- The host name or IP address of the host on which the remote agent is running.null
if unknown.
-
bootstrappingElastic
Description copied from interface:RemoteAgentManager
Notifies the
RemoteAgentManager
that an elastic agent has commenced bootstrapping.- Specified by:
bootstrappingElastic
in interfaceRemoteAgentManager
- Parameters:
agentHostName
- The host name or IP address of the host on which the remote agent is running.null
if unknown.instanceId
- the instance the elastic agent is loading on
-
addRemoteAgentLogEntry
- Specified by:
addRemoteAgentLogEntry
in interfaceRemoteAgentManager
-
stopConnectors
- Specified by:
stopConnectors
in interfaceRemoteAgentManager
- Throws:
Exception
-
start
- Specified by:
start
in interfaceRemoteAgentManager
- Throws:
Exception
-
getRemoteAgentLog
- Specified by:
getRemoteAgentLog
in interfaceRemoteAgentManager
-
setHeartbeatCheckInterval
public void setHeartbeatCheckInterval(int heartbeatCheckInterval) -
setHeartbeatInterval
public void setHeartbeatInterval(int heartbeatInterval) -
setUri
-