jetbrains.buildServer.serverSide
Interface SBuildAgent

All Superinterfaces:
AgentBuildHistory, AgentDescription, BuildAgent, java.lang.Comparable<BuildAgent>

public interface SBuildAgent
extends BuildAgent, AgentDescription, java.lang.Comparable<BuildAgent>, AgentBuildHistory

Represents agent on the server side.


Method Summary
 java.util.Date getAgentStatusRestoringTimestamp()
          Returns null if agent status will not be restored, otherwise returns status restoring timestamp
 java.lang.Boolean getAgentStatusToRestore()
          Returns null if agent status will not be restored, otherwise returns status to restore
 int getAgentTypeId()
          Agent can be real and virtual.
 java.lang.String getAuthorizationToken()
          Returns agent token which should be used to authorize build agent
 Comment getAuthorizeComment()
          Returns information about changing agent authorized status, including timestamp, user, comment text
 java.util.List<SBuildType> getBuildConfigurationsBuilt()
          Returns build configurations ever built on this agent.
 java.lang.String getHostAddress()
          Returns IP address of the computer where build agent is running
 java.lang.String getHostName()
          Returns hostname of the computer where build agent is running.
 long getIdleTime()
           
 java.util.Date getLastCommunicationTimestamp()
          Returns timestamp of the last agent - server (or server - agent) successful communication.
 java.lang.String getPluginsSignature()
          Returns signature of plugins installed on the agent.
 int getPort()
          Port where agent is listening for server commands.
 java.util.Date getRegistrationTimestamp()
          Returns timestamp of this agent registration.
 SRunningBuild getRunningBuild()
          Returns the build which is currently running on the agent; null if no such build available
 Comment getStatusComment()
          Returns information about changing agent enabled/disabled status, including timestamp, user, comment text
 java.lang.String getUnregistrationComment()
          If agent is not registered returns reason of its' unregistration.
 java.lang.String getVersion()
          Returns agent version.
 boolean isAuthorized()
          Returns true if agent is authorized by administrator.
 boolean isEnabled()
          Returns true if agent is enabled.
 boolean isOutdated()
          Returns true if version of this agent does not match version of the server.
 boolean isPluginsOutdated()
          Returns true if some of the agent plugins are outdated.
 boolean isRegistered()
          Returns true or false depending on whether this agent is currently registered on server or not.
 boolean ping()
          Try to ping agent over networks
 void releaseSources()
          Releases sources of all of the build configurations ever built on this agent, after that a full checkout will be performed for all of these configurations on this agent.
 void releaseSources(SBuildType buildType)
          Releases sources of the specified build configuration on this agent.
 void setAuthorized(boolean authorized, SUser user, java.lang.String reason)
          Changes this agent authorization status.
 void setEnabled(boolean enabled, SUser user, java.lang.String reason)
          Changes this agent enabled status.
 void setEnabled(boolean enabled, SUser user, java.lang.String reason, long statusRestoringTimestamp)
          Changes this agent enabled status and restores it in the specified time.
 
Methods inherited from interface jetbrains.buildServer.BuildAgent
getCpuBenchmarkIndex, getId, getName, isUpgrading
 
Methods inherited from interface jetbrains.buildServer.serverSide.AgentDescription
getAvailableParameters, getAvailableRunTypes, getAvailableVcsPlugins, getBuildParameters, getConfigurationParameters, getCpuBenchmarkIndex, getDefinedParameters, getOperatingSystemName, isCaseInsensitiveEnvironment
 
Methods inherited from interface java.lang.Comparable
compareTo
 
Methods inherited from interface jetbrains.buildServer.serverSide.AgentBuildHistory
getBuildHistory
 

Method Detail

getAgentTypeId

int getAgentTypeId()
Agent can be real and virtual. We want to merge all agents of the same type(kind) using this id. Returned "Integer" before 7.0.

Returns:
agent type id.
Since:
5.1

getVersion

@NotNull
java.lang.String getVersion()
Returns agent version.

Returns:
agent version

getPluginsSignature

@NotNull
java.lang.String getPluginsSignature()
Returns signature of plugins installed on the agent. The agent version and plugins signature are used to determine whether upgrade of this agent is required or not.

Returns:
signature of plugins installed on the agent.

isOutdated

boolean isOutdated()
Returns true if version of this agent does not match version of the server.

Returns:
see above

isPluginsOutdated

boolean isPluginsOutdated()
Returns true if some of the agent plugins are outdated.

Returns:
see above

getRunningBuild

@Nullable
SRunningBuild getRunningBuild()
Returns the build which is currently running on the agent; null if no such build available

Returns:
the build which is currently running on the agent; null if no such build available

getAuthorizationToken

@NotNull
java.lang.String getAuthorizationToken()
Returns agent token which should be used to authorize build agent

Returns:
agent token which should be used to authorize build agent

getHostName

java.lang.String getHostName()
Returns hostname of the computer where build agent is running. If server is unable to resolve agent address to host name the address is returned.

Returns:
Returns hostname of the computer where build agent is running

getHostAddress

java.lang.String getHostAddress()
Returns IP address of the computer where build agent is running

Returns:
see above

getPort

int getPort()
Port where agent is listening for server commands.

Returns:
see above

ping

boolean ping()
Try to ping agent over networks

Returns:
true if agent is reachable

isEnabled

boolean isEnabled()
Returns true if agent is enabled.

Specified by:
isEnabled in interface BuildAgent
Returns:
see above
See Also:
for additional information about agent status change

isAuthorized

boolean isAuthorized()
Returns true if agent is authorized by administrator.

Returns:
see above
See Also:
for additional information about agent status change

getStatusComment

@NotNull
Comment getStatusComment()
Returns information about changing agent enabled/disabled status, including timestamp, user, comment text

Returns:
see above
See Also:
Comment, isEnabled()

getAuthorizeComment

@NotNull
Comment getAuthorizeComment()
Returns information about changing agent authorized status, including timestamp, user, comment text

Returns:
see above
See Also:
Comment, isAuthorized()

isRegistered

boolean isRegistered()
Returns true or false depending on whether this agent is currently registered on server or not.

Returns:
see above

getUnregistrationComment

@Nullable
java.lang.String getUnregistrationComment()
If agent is not registered returns reason of its' unregistration.

Returns:
agent is not registered returns reason of its' unregistration.

getRegistrationTimestamp

@NotNull
java.util.Date getRegistrationTimestamp()
Returns timestamp of this agent registration. If agent is not registered the returned timestamp is timestamp of last agent registration.

Returns:
see above

getLastCommunicationTimestamp

java.util.Date getLastCommunicationTimestamp()
Returns timestamp of the last agent - server (or server - agent) successful communication.

Returns:
see above

setEnabled

void setEnabled(boolean enabled,
                @Nullable
                SUser user,
                @NotNull
                java.lang.String reason)
Changes this agent enabled status.

Parameters:
enabled - true if agent is enabled, and false otherwise
user - user who changes the status or null
reason - reason why the status is changed

setEnabled

void setEnabled(boolean enabled,
                @Nullable
                SUser user,
                @NotNull
                java.lang.String reason,
                long statusRestoringTimestamp)
Changes this agent enabled status and restores it in the specified time.

Parameters:
enabled - true if agent is enabled, and false otherwise
user - user who changes the status or null
reason - reason why the status is changed
statusRestoringTimestamp - timestamp at which agent status will be restored
Since:
4.0.2

setAuthorized

void setAuthorized(boolean authorized,
                   @Nullable
                   SUser user,
                   @NotNull
                   java.lang.String reason)
                   throws LicenseNotGrantedException
Changes this agent authorization status.

Parameters:
authorized - true if agent should become authorized and false otherwise
user - user who changes the status or null
reason - reason why the status changed
Throws:
LicenseNotGrantedException - if agent cannot be authorized because there is not enough license tokens

releaseSources

void releaseSources()
Releases sources of all of the build configurations ever built on this agent, after that a full checkout will be performed for all of these configurations on this agent.


releaseSources

void releaseSources(@NotNull
                    SBuildType buildType)
Releases sources of the specified build configuration on this agent. A full checkout will be performed when a build of this build configuration is started on this agent.

Parameters:
buildType - build configuration

getBuildConfigurationsBuilt

@NotNull
java.util.List<SBuildType> getBuildConfigurationsBuilt()
Returns build configurations ever built on this agent.

Returns:
see above

getAgentStatusToRestore

@Nullable
java.lang.Boolean getAgentStatusToRestore()
Returns null if agent status will not be restored, otherwise returns status to restore

Returns:
null if agent status will not be restored, otherwise returns status to restore

getAgentStatusRestoringTimestamp

@Nullable
java.util.Date getAgentStatusRestoringTimestamp()
Returns null if agent status will not be restored, otherwise returns status restoring timestamp

Returns:
null if agent status will not be restored, otherwise returns status restoring timestamp

getIdleTime

long getIdleTime()
Returns:
number of milliseconds build agent was idle. If there was no build started time since registration is returned. If agent is running a build, 0 is returned.