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
-
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
ConstructorsModifierConstructorDescriptionBuildAgentImpl(@NotNull PipelineDefinition definition, @NotNull AgentStatus agentStatus) protectedBuildAgentImpl(LocalAgentDefinition definition) -
Method Summary
Modifier and TypeMethodDescriptionvoidaccept(BuildAgent.BuildAgentVisitor buildAgentVisitor) Runs the appropriate visitor method depending on which type of agent it isintboolean@NotNull AgentStatus@NotNull PipelineDefinitionlonggetId()getName()@Nullable Date@Nullable SystemInfoGets the system info, which may benullif not yet initialized.getType()getUuid()Get UUID of this agentinthashCode()booleanChecks whether system info for this agent has been initialized.booleanhasUuid()Check whether this agent has already been assigned its UUIDintbooleanisActive()booleanisBusy()Returns true if an agent is building or is cancelling a buildbooleanbooleanbooleanWhether or not a call has been made to shutdown the agent after the current build has finishedbooleanWhether or not the agent has been deemed to be "unresponsive".voidvoidsetAgentStatus(@NotNull AgentStatus newAgentStatus) voidsetDefinition(@NotNull PipelineDefinition definition) voidsetLastUpdated(Date lastUpdated) voidsetRemoteTimestamp(Date remoteTimestamp) voidsetRequestedToBeStopped(boolean requestedToBeStopped) voidsetSystemInfo(SystemInfo systemInfo) voidsetUnresponsive(boolean unresponsive) voidtoString()
-
Constructor Details
-
BuildAgentImpl
public BuildAgentImpl(@NotNull @NotNull PipelineDefinition definition, @NotNull @NotNull AgentStatus agentStatus) -
BuildAgentImpl
-
-
Method Details
-
getId
public long getId()- Specified by:
getIdin interfaceBambooIdProvider- Specified by:
getIdin interfaceBuildAgent
-
getName
- Specified by:
getNamein interfaceBuildAgent- Specified by:
getNamein interfaceNameProvider
-
getType
- Specified by:
getTypein interfaceBuildAgent
-
isActive
public boolean isActive()- Specified by:
isActivein interfaceBuildAgent
-
isEnabled
public boolean isEnabled()- Specified by:
isEnabledin interfaceBuildAgent
-
getAgentStatus
- Specified by:
getAgentStatusin interfaceBuildAgent
-
isUnresponsive
public boolean isUnresponsive()Description copied from interface:BuildAgentWhether 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:
isUnresponsivein interfaceBuildAgent- Returns:
-
setUnresponsive
public void setUnresponsive(boolean unresponsive) - Specified by:
setUnresponsivein interfaceBuildAgent
-
setAgentStatus
-
isBusy
public boolean isBusy()Description copied from interface:BuildAgentReturns true if an agent is building or is cancelling a build- Specified by:
isBusyin interfaceBuildAgent- Returns:
-
getLastUpdated
-
setLastUpdated
-
getRemoteTimestamp
-
setRemoteTimestamp
-
getSystemInfo
Description copied from interface:HasSystemInfoGets the system info, which may benullif not yet initialized.- Specified by:
getSystemInfoin interfaceHasSystemInfo- Returns:
- system info of this agent
-
hasSystemInfo
public boolean hasSystemInfo()Description copied from interface:HasSystemInfoChecks whether system info for this agent has been initialized. Iftrue,HasSystemInfo.getSystemInfo()will always return non-nullvalue- Specified by:
hasSystemInfoin interfaceHasSystemInfo- Returns:
true, if this agent has system info
-
setSystemInfo
-
isRequestedToBeStopped
public boolean isRequestedToBeStopped()Description copied from interface:BuildAgentWhether or not a call has been made to shutdown the agent after the current build has finished- Specified by:
isRequestedToBeStoppedin interfaceBuildAgent- Returns:
-
setRequestedToBeStopped
public void setRequestedToBeStopped(boolean requestedToBeStopped) - Specified by:
setRequestedToBeStoppedin interfaceBuildAgent
-
getDefinition
- Specified by:
getDefinitionin interfaceBuildAgent
-
setDefinition
- Specified by:
setDefinitionin interfaceBuildAgent
-
accept
Description copied from interface:BuildAgentRuns the appropriate visitor method depending on which type of agent it is- Specified by:
acceptin interfaceBuildAgent
-
isDedicated
public boolean isDedicated()- Specified by:
isDedicatedin interfaceBuildAgent
-
incrementAndGetHeartbeatsWhileBuildingCounter
public int incrementAndGetHeartbeatsWhileBuildingCounter() -
resetHeartbeatsWhileBuildingCounter
public void resetHeartbeatsWhileBuildingCounter() -
hashCode
public int hashCode() -
equals
-
compareTo
- Specified by:
compareToin interfaceComparable<BuildAgent>
-
toString
-
getUuid
Description copied from interface:HasUuidGet UUID of this agent -
setUuid
-
hasUuid
public boolean hasUuid()Description copied from interface:HasUuidCheck whether this agent has already been assigned its UUID
-