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 void
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
checkOfflineAgents()
Runs a check for offline remote agents.List<String>
getRemoteAgentLog()
void
init()
Initialize the state of the component.boolean
isRemoteAgentFunctionEnabled()
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
setUri(String uri)
void
start()
void
stopConnectors()
void
stopRemoteAgent(@NotNull BuildAgent agent)
AgentHeartBeatInfo
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 Detail
-
RemoteAgentManagerImpl
public RemoteAgentManagerImpl(int heartbeatTimeoutSeconds, StartupStatisticsBean startupStatisticsBean, com.atlassian.event.api.EventPublisher eventPublisher)
-
-
Method Detail
-
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
public void setRemoteAgentFunctionEnabled(boolean remoteAgentFunctionEnabled) throws Exception
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
public void stopRemoteAgent(@NotNull @NotNull BuildAgent agent)
- Specified by:
stopRemoteAgent
in interfaceRemoteAgentManager
-
bootstrapping
public void bootstrapping(String agentHostName)
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
public void bootstrappingEphemeral(String agentHostName)
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
public void bootstrappingElastic(String agentHostName, @Nullable @Nullable String instanceId)
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
public void addRemoteAgentLogEntry(String logEntry)
- Specified by:
addRemoteAgentLogEntry
in interfaceRemoteAgentManager
-
stopConnectors
public void stopConnectors() throws Exception
- Specified by:
stopConnectors
in interfaceRemoteAgentManager
- Throws:
Exception
-
start
public void start() throws Exception
- Specified by:
start
in interfaceRemoteAgentManager
- Throws:
Exception
-
getRemoteAgentLog
public List<String> getRemoteAgentLog()
- Specified by:
getRemoteAgentLog
in interfaceRemoteAgentManager
-
setHeartbeatCheckInterval
public void setHeartbeatCheckInterval(int heartbeatCheckInterval)
-
setHeartbeatInterval
public void setHeartbeatInterval(int heartbeatInterval)
-
setUri
public void setUri(String uri)
-
-