Class BuildAgentDecorator
- java.lang.Object
-
- com.atlassian.bamboo.ww2.actions.agent.BuildAgentDecorator
-
- All Implemented Interfaces:
BambooIdProvider,NameProvider,BuildAgent,Comparable<BuildAgent>
public class BuildAgentDecorator extends Object implements BuildAgent
-
-
Nested Class Summary
-
Nested classes/interfaces inherited from interface com.atlassian.bamboo.v2.build.agent.BuildAgent
BuildAgent.BuildAgentVisitor
-
-
Field Summary
Fields Modifier and Type Field Description static com.google.common.base.Function<BuildAgent,BuildAgentDecorator>toDecorator-
Fields inherited from interface com.atlassian.bamboo.v2.build.agent.BuildAgent
EPHEMERAL_AGENT_TEMPLATE_ID_KEY, EPHEMERAL_AGENT_TEMPLATE_NAME_KEY
-
-
Constructor Summary
Constructors Constructor Description BuildAgentDecorator(@NotNull BuildAgent buildAgent)
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description voidaccept(BuildAgent.BuildAgentVisitor buildAgentVisitor)Runs the appropriate visitor method depending on which type of agent it isintcompareTo(BuildAgent buildAgent)@NotNull AgentStatusgetAgentStatus()@NotNull PipelineDefinitiongetDefinition()longgetId()@NotNull com.opensymphony.webwork.dispatcher.json.JSONObjectgetJson()@NotNull com.opensymphony.webwork.dispatcher.json.JSONObjectgetJson(boolean includeAllProperties)StringgetName()AgentTypegetType()booleanisActive()booleanisBusy()Returns true if an agent is building or is cancelling a buildbooleanisDedicated()booleanisEnabled()booleanisRequestedToBeStopped()Whether or not a call has been made to shutdown the agent after the current build has finishedbooleanisUnresponsive()Whether or not the agent has been deemed to be "unresponsive".voidsetDefinition(@NotNull PipelineDefinition definition)voidsetRequestedToBeStopped(boolean requestedToBeStopped)voidsetUnresponsive(boolean unresponsive)
-
-
-
Field Detail
-
toDecorator
public static com.google.common.base.Function<BuildAgent,BuildAgentDecorator> toDecorator
-
-
Constructor Detail
-
BuildAgentDecorator
public BuildAgentDecorator(@NotNull @NotNull BuildAgent buildAgent)
-
-
Method Detail
-
getJson
@NotNull public @NotNull com.opensymphony.webwork.dispatcher.json.JSONObject getJson(boolean includeAllProperties)
-
getJson
@NotNull public @NotNull com.opensymphony.webwork.dispatcher.json.JSONObject getJson() throws com.opensymphony.webwork.dispatcher.json.JSONException- Throws:
com.opensymphony.webwork.dispatcher.json.JSONException
-
getId
public long getId()
- Specified by:
getIdin interfaceBambooIdProvider- Specified by:
getIdin interfaceBuildAgent
-
getName
public String getName()
- Specified by:
getNamein interfaceBuildAgent- Specified by:
getNamein interfaceNameProvider
-
isActive
public boolean isActive()
- Specified by:
isActivein interfaceBuildAgent
-
isEnabled
public boolean isEnabled()
- Specified by:
isEnabledin interfaceBuildAgent
-
getAgentStatus
@NotNull public @NotNull AgentStatus getAgentStatus()
- Specified by:
getAgentStatusin interfaceBuildAgent
-
getDefinition
@NotNull public @NotNull PipelineDefinition getDefinition()
- Specified by:
getDefinitionin interfaceBuildAgent
-
setDefinition
public void setDefinition(@NotNull @NotNull PipelineDefinition definition)- Specified by:
setDefinitionin interfaceBuildAgent
-
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
-
accept
public void accept(BuildAgent.BuildAgentVisitor buildAgentVisitor)
Description copied from interface:BuildAgentRuns the appropriate visitor method depending on which type of agent it is- Specified by:
acceptin 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
-
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:
-
compareTo
public int compareTo(BuildAgent buildAgent)
- Specified by:
compareToin interfaceComparable<BuildAgent>
-
getType
public AgentType getType()
- Specified by:
getTypein interfaceBuildAgent
-
isDedicated
public boolean isDedicated()
- Specified by:
isDedicatedin interfaceBuildAgent
-
-