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 void
accept(BuildAgent.BuildAgentVisitor buildAgentVisitor)
Runs the appropriate visitor method depending on which type of agent it isint
compareTo(BuildAgent buildAgent)
@NotNull AgentStatus
getAgentStatus()
@NotNull PipelineDefinition
getDefinition()
long
getId()
@NotNull com.opensymphony.webwork.dispatcher.json.JSONObject
getJson()
@NotNull com.opensymphony.webwork.dispatcher.json.JSONObject
getJson(boolean includeAllProperties)
String
getName()
AgentType
getType()
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
setDefinition(@NotNull PipelineDefinition definition)
void
setRequestedToBeStopped(boolean requestedToBeStopped)
void
setUnresponsive(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:
getId
in interfaceBambooIdProvider
- Specified by:
getId
in interfaceBuildAgent
-
getName
public String getName()
- Specified by:
getName
in interfaceBuildAgent
- Specified by:
getName
in interfaceNameProvider
-
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
-
getDefinition
@NotNull public @NotNull PipelineDefinition getDefinition()
- Specified by:
getDefinition
in interfaceBuildAgent
-
setDefinition
public void setDefinition(@NotNull @NotNull PipelineDefinition definition)
- Specified by:
setDefinition
in interfaceBuildAgent
-
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
-
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
-
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
-
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:
-
compareTo
public int compareTo(BuildAgent buildAgent)
- Specified by:
compareTo
in interfaceComparable<BuildAgent>
-
getType
public AgentType getType()
- Specified by:
getType
in interfaceBuildAgent
-
isDedicated
public boolean isDedicated()
- Specified by:
isDedicated
in interfaceBuildAgent
-
-