com.atlassian.bamboo.v2.build.agent
Class BuildAgentImpl

java.lang.Object
  extended by com.atlassian.bamboo.v2.build.agent.BuildAgentImpl
All Implemented Interfaces:
NameProvider, BuildAgent, HasSystemInfo, HasUuid, java.lang.Comparable<BuildAgent>
Direct Known Subclasses:
LocalBuildAgentImpl

public class BuildAgentImpl
extends java.lang.Object
implements BuildAgent, HasUuid, HasSystemInfo


Nested Class Summary
 
Nested classes/interfaces inherited from interface com.atlassian.bamboo.v2.build.agent.BuildAgent
BuildAgent.BuildAgentVisitor
 
Constructor Summary
protected BuildAgentImpl(LocalAgentDefinition definition)
           
  BuildAgentImpl(PipelineDefinition definition, AgentStatus agentStatus)
           
 
Method Summary
 void accept(BuildAgent.BuildAgentVisitor buildAgentVisitor)
          Runs the appropriate visitor method depending on which type of agent it is
 int compareTo(BuildAgent o)
           
 boolean equals(java.lang.Object o)
           
 AgentStatus getAgentStatus()
           
 PipelineDefinition getDefinition()
           
 long getId()
           
 java.util.Date getLastUpdated()
           
 java.lang.String getName()
           
 java.util.Date getRemoteTimestamp()
           
 SystemInfo getSystemInfo()
          Gets the system info, which may be null if not yet initialized.
 java.util.UUID getUuid()
          Get UUID of this agent
 int hashCode()
           
 boolean hasSystemInfo()
          Checks whether system info for this agent has been initialized.
 boolean hasUuid()
          Check whether this agent has already been assigned its UUID
 boolean isActive()
           
 boolean isBusy()
          Returns true if an agent is building or is cancelling a build
 boolean isEnabled()
           
 boolean isRequestedToBeStopped()
          Whether or not a call has been made to shutdown the agent after the current build has finished
 boolean isUnresponsive()
          Whether or not the agent has been deemed to be "unresponsive".
 void setAgentStatus(AgentStatus newAgentStatus)
           
 void setDefinition(PipelineDefinition definition)
           
 void setLastUpdated(java.util.Date lastUpdated)
           
 void setRemoteTimestamp(java.util.Date remoteTimestamp)
           
 void setRequestedToBeStopped(boolean requestedToBeStopped)
           
 void setSystemInfo(SystemInfo systemInfo)
           
 void setUnresponsive(boolean unresponsive)
           
 void setUuid(java.util.UUID uuid)
           
 java.lang.String toString()
           
 
Methods inherited from class java.lang.Object
clone, finalize, getClass, notify, notifyAll, wait, wait, wait
 

Constructor Detail

BuildAgentImpl

public BuildAgentImpl(@NotNull
                      PipelineDefinition definition,
                      @NotNull
                      AgentStatus agentStatus)

BuildAgentImpl

protected BuildAgentImpl(LocalAgentDefinition definition)
Method Detail

getId

public long getId()
Specified by:
getId in interface BuildAgent

getName

public java.lang.String getName()
Specified by:
getName in interface NameProvider
Specified by:
getName in interface BuildAgent

isActive

public boolean isActive()
Specified by:
isActive in interface BuildAgent

isEnabled

public boolean isEnabled()
Specified by:
isEnabled in interface BuildAgent

getAgentStatus

@NotNull
public AgentStatus getAgentStatus()
Specified by:
getAgentStatus in interface BuildAgent

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 interface BuildAgent
Returns:

setUnresponsive

public void setUnresponsive(boolean unresponsive)
Specified by:
setUnresponsive in interface BuildAgent

setAgentStatus

public void setAgentStatus(@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 interface BuildAgent
Returns:

getLastUpdated

public java.util.Date getLastUpdated()

setLastUpdated

public void setLastUpdated(java.util.Date lastUpdated)

getRemoteTimestamp

@Nullable
public java.util.Date getRemoteTimestamp()

setRemoteTimestamp

public void setRemoteTimestamp(java.util.Date remoteTimestamp)

getSystemInfo

@Nullable
public SystemInfo getSystemInfo()
Description copied from interface: HasSystemInfo
Gets the system info, which may be null if not yet initialized.

Specified by:
getSystemInfo in interface HasSystemInfo
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. If true, HasSystemInfo.getSystemInfo() will always return non-null value

Specified by:
hasSystemInfo in interface HasSystemInfo
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 interface BuildAgent
Returns:

setRequestedToBeStopped

public void setRequestedToBeStopped(boolean requestedToBeStopped)
Specified by:
setRequestedToBeStopped in interface BuildAgent

getDefinition

@NotNull
public PipelineDefinition getDefinition()
Specified by:
getDefinition in interface BuildAgent

setDefinition

public void setDefinition(@NotNull
                          PipelineDefinition definition)
Specified by:
setDefinition in interface BuildAgent

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 interface BuildAgent

hashCode

public int hashCode()
Overrides:
hashCode in class java.lang.Object

equals

public boolean equals(java.lang.Object o)
Overrides:
equals in class java.lang.Object

compareTo

public int compareTo(BuildAgent o)
Specified by:
compareTo in interface java.lang.Comparable<BuildAgent>

toString

public java.lang.String toString()
Overrides:
toString in class java.lang.Object

getUuid

public java.util.UUID getUuid()
Description copied from interface: HasUuid
Get UUID of this agent

Specified by:
getUuid in interface HasUuid
Returns:
UUID of this agent

setUuid

public void setUuid(java.util.UUID uuid)

hasUuid

public boolean hasUuid()
Description copied from interface: HasUuid
Check whether this agent has already been assigned its UUID

Specified by:
hasUuid in interface HasUuid
Returns:
true, if this agent already has unique ID assigned


Copyright © 2012 Atlassian. All Rights Reserved.