com.atlassian.bamboo.buildqueue.manager
Class RemoteAgentManagerImpl

java.lang.Object
  extended by com.atlassian.bamboo.buildqueue.manager.RemoteAgentManagerImpl
All Implemented Interfaces:
RemoteAgentManager

public class RemoteAgentManagerImpl
extends Object
implements RemoteAgentManager


Constructor Summary
RemoteAgentManagerImpl(int heartbeatTimeoutSeconds, StartupStatisticsBean startupStatisticsBean, com.atlassian.event.api.EventPublisher eventPublisher)
           
 
Method Summary
 void addRemoteAgentLogEntry(String logEntry)
           
 void bootstrapping(String agentHostName)
          Notifies the RemoteAgentManager that a remote agent has commenced bootstrapping.
 void bootstrappingElastic(String agentHostName, String instanceId)
          Notifies the RemoteAgentManager that an elastic agent has commenced bootstrapping.
 void checkOfflineAgents()
          Runs a check for offline remote agents.
 List<String> getRemoteAgentLog()
           
 boolean isRemoteAgentFunctionEnabled()
          Checks whether the remote agent functionality is currently enabled.
 PipelineDefinition registerAgent(PipelineDefinition remoteAgentDefinition)
          Initial setup / verification of the agent.
 void setAgentManager(AgentManager agentManager)
           
 void setBrokerService(org.apache.activemq.broker.BrokerService brokerService)
           
 void setElasticFunctionalityFacade(ElasticFunctionalityFacade elasticFunctionalityFacade)
           
 void setHeartbeatCheckInterval(int heartbeatCheckInterval)
           
 void setPersister(Persister persister)
           
 void setRemoteAgentFunctionEnabled(boolean remoteAgentFunctionEnabled)
          Controls whether the remote agent functionality of Bamboo is enabled.
 void setUri(String uri)
           
 void start()
           
 void stopConnectors()
           
 void stopRemoteAgent(BuildAgent agent)
           
protected  void updateNameForDuplicates(PipelineDefinition remoteAgentDefinition)
           
 AgentHeartBeatInfo updateRemoteAgentStatus(Long agentId, UUID uuid, AgentStatus newStatus, SystemInfo systemInfo)
          Updates the BuildAgent's status representing a remote agent on the local server.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

RemoteAgentManagerImpl

public RemoteAgentManagerImpl(int heartbeatTimeoutSeconds,
                              StartupStatisticsBean startupStatisticsBean,
                              com.atlassian.event.api.EventPublisher eventPublisher)
Method Detail

registerAgent

@NotNull
public PipelineDefinition registerAgent(@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 interface RemoteAgentManager
Parameters:
remoteAgentDefinition - - id may be -1 if the build is new
Returns:
RemoteAgentDefinition with the id filled
Throws:
BambooLicenseException

updateRemoteAgentStatus

public AgentHeartBeatInfo updateRemoteAgentStatus(@NotNull
                                                  Long agentId,
                                                  @Nullable
                                                  UUID uuid,
                                                  @NotNull
                                                  AgentStatus newStatus,
                                                  @NotNull
                                                  SystemInfo systemInfo)
Description copied from interface: RemoteAgentManager
Updates the BuildAgent's status representing a remote agent on the local server.

Specified by:
updateRemoteAgentStatus in interface RemoteAgentManager
Parameters:
agentId - ID of the agent
uuid - UUID of the agent
newStatus - agent status
systemInfo - 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 interface RemoteAgentManager

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 interface RemoteAgentManager
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 interface RemoteAgentManager
Returns:
true, if remote agent functionality is enabled, false otherwise

stopRemoteAgent

public void stopRemoteAgent(@NotNull
                            BuildAgent agent)
Specified by:
stopRemoteAgent in interface RemoteAgentManager

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 interface RemoteAgentManager
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
                                 String instanceId)
Description copied from interface: RemoteAgentManager

Notifies the RemoteAgentManager that an elastic agent has commenced bootstrapping.

Specified by:
bootstrappingElastic in interface RemoteAgentManager
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

updateNameForDuplicates

protected void updateNameForDuplicates(PipelineDefinition remoteAgentDefinition)

addRemoteAgentLogEntry

public void addRemoteAgentLogEntry(String logEntry)
Specified by:
addRemoteAgentLogEntry in interface RemoteAgentManager

stopConnectors

public void stopConnectors()
                    throws Exception
Specified by:
stopConnectors in interface RemoteAgentManager
Throws:
Exception

start

public void start()
           throws Exception
Specified by:
start in interface RemoteAgentManager
Throws:
Exception

setAgentManager

public void setAgentManager(AgentManager agentManager)

setPersister

public void setPersister(Persister persister)

setHeartbeatCheckInterval

public void setHeartbeatCheckInterval(int heartbeatCheckInterval)

getRemoteAgentLog

public List<String> getRemoteAgentLog()
Specified by:
getRemoteAgentLog in interface RemoteAgentManager

setBrokerService

public void setBrokerService(org.apache.activemq.broker.BrokerService brokerService)

setUri

public void setUri(String uri)

setElasticFunctionalityFacade

public void setElasticFunctionalityFacade(ElasticFunctionalityFacade elasticFunctionalityFacade)


Copyright © 2015 Atlassian Software Systems Pty Ltd. All rights reserved.