Class BuildAgentImpl
- java.lang.Object
-
- com.atlassian.bamboo.v2.build.agent.BuildAgentImpl
-
- All Implemented Interfaces:
BambooIdProvider
,NameProvider
,BuildAgent
,HasSystemInfo
,HasUuid
,Comparable<BuildAgent>
- Direct Known Subclasses:
LocalBuildAgentImpl
public class BuildAgentImpl extends Object implements BuildAgent, HasUuid, HasSystemInfo
-
-
Nested Class Summary
-
Nested classes/interfaces inherited from interface com.atlassian.bamboo.v2.build.agent.BuildAgent
BuildAgent.BuildAgentVisitor
-
-
Field Summary
-
Fields inherited from interface com.atlassian.bamboo.v2.build.agent.BuildAgent
EPHEMERAL_AGENT_TEMPLATE_ID_KEY, EPHEMERAL_AGENT_TEMPLATE_NAME_KEY
-
-
Constructor Summary
Constructors Modifier Constructor Description BuildAgentImpl(@NotNull PipelineDefinition definition, @NotNull AgentStatus agentStatus)
protected
BuildAgentImpl(LocalAgentDefinition definition)
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description void
accept(BuildAgent.BuildAgentVisitor buildAgentVisitor)
Runs the appropriate visitor method depending on which type of agent it isint
compareTo(BuildAgent o)
boolean
equals(Object o)
@NotNull AgentStatus
getAgentStatus()
@NotNull PipelineDefinition
getDefinition()
long
getId()
Date
getLastUpdated()
String
getName()
@Nullable Date
getRemoteTimestamp()
@Nullable SystemInfo
getSystemInfo()
Gets the system info, which may benull
if not yet initialized.AgentType
getType()
UUID
getUuid()
Get UUID of this agentint
hashCode()
boolean
hasSystemInfo()
Checks whether system info for this agent has been initialized.boolean
hasUuid()
Check whether this agent has already been assigned its UUIDint
incrementAndGetHeartbeatsWhileBuildingCounter()
boolean
isActive()
boolean
isBusy()
Returns true if an agent is building or is cancelling a buildboolean
isDedicated()
boolean
isEnabled()
boolean
isRequestedToBeStopped()
Whether or not a call has been made to shutdown the agent after the current build has finishedboolean
isUnresponsive()
Whether or not the agent has been deemed to be "unresponsive".void
resetHeartbeatsWhileBuildingCounter()
void
setAgentStatus(@NotNull AgentStatus newAgentStatus)
void
setDefinition(@NotNull PipelineDefinition definition)
void
setLastUpdated(Date lastUpdated)
void
setRemoteTimestamp(Date remoteTimestamp)
void
setRequestedToBeStopped(boolean requestedToBeStopped)
void
setSystemInfo(SystemInfo systemInfo)
void
setUnresponsive(boolean unresponsive)
void
setUuid(UUID uuid)
String
toString()
-
-
-
Constructor Detail
-
BuildAgentImpl
public BuildAgentImpl(@NotNull @NotNull PipelineDefinition definition, @NotNull @NotNull AgentStatus agentStatus)
-
BuildAgentImpl
protected BuildAgentImpl(LocalAgentDefinition definition)
-
-
Method Detail
-
getId
public long getId()
- Specified by:
getId
in interfaceBambooIdProvider
- Specified by:
getId
in interfaceBuildAgent
-
getName
public String getName()
- Specified by:
getName
in interfaceBuildAgent
- Specified by:
getName
in interfaceNameProvider
-
getType
public AgentType getType()
- Specified by:
getType
in interfaceBuildAgent
-
isActive
public boolean isActive()
- Specified by:
isActive
in interfaceBuildAgent
-
isEnabled
public boolean isEnabled()
- Specified by:
isEnabled
in interfaceBuildAgent
-
getAgentStatus
@NotNull public @NotNull AgentStatus getAgentStatus()
- Specified by:
getAgentStatus
in interfaceBuildAgent
-
isUnresponsive
public boolean isUnresponsive()
Description copied from interface:BuildAgent
Whether or not the agent has been deemed to be "unresponsive". Agents will be first marked as unresponsive before they are made offline.Used for remote agents.
- Specified by:
isUnresponsive
in interfaceBuildAgent
- Returns:
-
setUnresponsive
public void setUnresponsive(boolean unresponsive)
- Specified by:
setUnresponsive
in interfaceBuildAgent
-
setAgentStatus
public void setAgentStatus(@NotNull @NotNull AgentStatus newAgentStatus)
-
isBusy
public boolean isBusy()
Description copied from interface:BuildAgent
Returns true if an agent is building or is cancelling a build- Specified by:
isBusy
in interfaceBuildAgent
- Returns:
-
getLastUpdated
public Date getLastUpdated()
-
setLastUpdated
public void setLastUpdated(Date lastUpdated)
-
getRemoteTimestamp
@Nullable public @Nullable Date getRemoteTimestamp()
-
setRemoteTimestamp
public void setRemoteTimestamp(Date remoteTimestamp)
-
getSystemInfo
@Nullable public @Nullable SystemInfo getSystemInfo()
Description copied from interface:HasSystemInfo
Gets the system info, which may benull
if not yet initialized.- Specified by:
getSystemInfo
in interfaceHasSystemInfo
- Returns:
- system info of this agent
-
hasSystemInfo
public boolean hasSystemInfo()
Description copied from interface:HasSystemInfo
Checks whether system info for this agent has been initialized. Iftrue
,HasSystemInfo.getSystemInfo()
will always return non-null
value- Specified by:
hasSystemInfo
in interfaceHasSystemInfo
- Returns:
true
, if this agent has system info
-
setSystemInfo
public void setSystemInfo(SystemInfo systemInfo)
-
isRequestedToBeStopped
public boolean isRequestedToBeStopped()
Description copied from interface:BuildAgent
Whether or not a call has been made to shutdown the agent after the current build has finished- Specified by:
isRequestedToBeStopped
in interfaceBuildAgent
- Returns:
-
setRequestedToBeStopped
public void setRequestedToBeStopped(boolean requestedToBeStopped)
- Specified by:
setRequestedToBeStopped
in interfaceBuildAgent
-
getDefinition
@NotNull public @NotNull PipelineDefinition getDefinition()
- Specified by:
getDefinition
in interfaceBuildAgent
-
setDefinition
public void setDefinition(@NotNull @NotNull PipelineDefinition definition)
- Specified by:
setDefinition
in interfaceBuildAgent
-
accept
public void accept(BuildAgent.BuildAgentVisitor buildAgentVisitor)
Description copied from interface:BuildAgent
Runs the appropriate visitor method depending on which type of agent it is- Specified by:
accept
in interfaceBuildAgent
-
isDedicated
public boolean isDedicated()
- Specified by:
isDedicated
in interfaceBuildAgent
-
incrementAndGetHeartbeatsWhileBuildingCounter
public int incrementAndGetHeartbeatsWhileBuildingCounter()
-
resetHeartbeatsWhileBuildingCounter
public void resetHeartbeatsWhileBuildingCounter()
-
compareTo
public int compareTo(BuildAgent o)
- Specified by:
compareTo
in interfaceComparable<BuildAgent>
-
setUuid
public void setUuid(UUID uuid)
-
-