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 java.lang.Object
implements RemoteAgentManager


Constructor Summary
RemoteAgentManagerImpl(int heartbeatTimeoutSeconds, StartupStatisticsBean startupStatisticsBean)
           
 
Method Summary
 void addRemoteAgentLogEntry(java.lang.String logEntry)
           
 void bootstrapping(java.lang.String agentHostName)
          Notifies the RemoteAgentManager that a remote agent has commenced bootstrapping.
 void bootstrappingElastic(java.lang.String agentHostName, java.lang.String instanceId)
          Notifies the RemoteAgentManager that an elastic agent has commenced bootstrapping.
 void checkOfflineAgents()
          Runs a check for offline remote agents.
 java.util.List<java.lang.String> getRemoteAgentLog()
           
 boolean isRemoteAgentFunctionEnabled()
           
 PipelineDefinition registerAgent(PipelineDefinition remoteAgentDefinition)
          Initial setup / verification of the agent.
 void setBrokerService(org.apache.activemq.broker.BrokerService brokerService)
           
 void setElasticFunctionalityFacade(ElasticFunctionalityFacade elasticFunctionalityFacade)
           
 void setErrorUpdateHander(ErrorUpdateHandler errorUpdateHander)
           
 void setEventManager(com.atlassian.event.EventManager eventManager)
           
 void setHeartbeatCheckInterval(int heartbeatCheckInterval)
           
 void setLocalAgentManager(LocalAgentManager localAgentManager)
           
 void setPersister(Persister persister)
           
 void setRemoteAgentFunctionEnabled(boolean remoteAgentFunctionEnabled)
          Controls whether the remote agent functionality of Bamboo is enabled.
 void setUri(java.lang.String uri)
           
 void start()
           
 void stopConnectors()
           
 void stopRemoteAgent(BuildAgent agent)
           
protected  void updateNameForDuplicates(PipelineDefinition remoteAgentDefinition)
           
 AgentHeartBeatInfo updateRemoteAgentStatus(java.lang.Long agentId, AgentStatus status, 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)
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
                                                  java.lang.Long agentId,
                                                  @NotNull
                                                  AgentStatus status,
                                                  @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
Returns:

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 java.lang.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:
java.lang.Exception

isRemoteAgentFunctionEnabled

public boolean isRemoteAgentFunctionEnabled()
Specified by:
isRemoteAgentFunctionEnabled in interface RemoteAgentManager

stopRemoteAgent

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

bootstrapping

public void bootstrapping(java.lang.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(java.lang.String agentHostName,
                                 @Nullable
                                 java.lang.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(java.lang.String logEntry)
Specified by:
addRemoteAgentLogEntry in interface RemoteAgentManager

stopConnectors

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

start

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

setLocalAgentManager

public void setLocalAgentManager(LocalAgentManager localAgentManager)

setErrorUpdateHander

public void setErrorUpdateHander(ErrorUpdateHandler errorUpdateHander)

setPersister

public void setPersister(Persister persister)

setHeartbeatCheckInterval

public void setHeartbeatCheckInterval(int heartbeatCheckInterval)

getRemoteAgentLog

public java.util.List<java.lang.String> getRemoteAgentLog()
Specified by:
getRemoteAgentLog in interface RemoteAgentManager

setBrokerService

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

setUri

public void setUri(java.lang.String uri)

setElasticFunctionalityFacade

public void setElasticFunctionalityFacade(ElasticFunctionalityFacade elasticFunctionalityFacade)

setEventManager

public void setEventManager(com.atlassian.event.EventManager eventManager)


Copyright © 2010 Atlassian. All Rights Reserved.