Class AbstractBuildAgent
- java.lang.Object
-
- jetbrains.buildServer.serverSide.impl.Proxyfied<BuildAgentEx>
-
- jetbrains.buildServer.serverSide.impl.agent.AbstractBuildAgentContext
-
- jetbrains.buildServer.serverSide.impl.agent.AbstractBuildAgent
-
- All Implemented Interfaces:
Comparable<BuildAgent>,BuildAgent,Loggable,AgentBuildHistory,AgentDescription,BuildAgentEx,BuildAgentInit,SBuildAgent
- Direct Known Subclasses:
DeadAgent,MockBuildAgent,RegisteredAgent,UnregisteredAgent
public abstract class AbstractBuildAgent extends AbstractBuildAgentContext implements BuildAgentEx
- Author:
- Pavel.Sher Date: 12.01.2007
-
-
Field Summary
Fields Modifier and Type Field Description static StringFAILED_TO_FIND_AGENT_TYPE_FOR_AGENT_MSG_PREFIX-
Fields inherited from class jetbrains.buildServer.serverSide.impl.agent.AbstractBuildAgentContext
myContext
-
Fields inherited from interface jetbrains.buildServer.BuildAgent
DEFAULT_POOL_ID, DEFAULT_POOL_NAME
-
-
Constructor Summary
Constructors Constructor Description AbstractBuildAgent(AgentDescription description, String authorizationToken, AgentContext context, CurrentAgentVersionProvider currentAgentVersionProvider)
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description voidbuildStartedOnAgent(SRunningBuild build)Called when a new build is started on this agentbooleancanStartBuildIfAgentOutdated()voidclearSpecialState(BuildAgentSpecialState specialState)Clears special state if set to the given valueintcompareTo(BuildAgent agent)Stringdescribe(boolean verbose)voidgenerateUniqueAgentAuthorizationToken()Generates new agent authorization token for this agent.AgentPoolgetAgentPool()intgetAgentPoolId()Returns the pool id the agent belongs to.DategetAgentStatusRestoringTimestamp()Returns null if agent status will not be restored, otherwise returns status restoring timestampBooleangetAgentStatusToRestore()Returns null if agent status will not be restored, otherwise returns status to restoreSAgentTypegetAgentType()intgetAgentTypeId()Returns id of this agent type.StringgetAuthorizationToken()Returns agent token which should be used to authorize build agentCommentgetAuthorizeComment()Returns information about changing agent authorized status, including timestamp, user, comment textMap<String,String>getAvailableParameters()Returns map of parameters available on the agent.StringgetAvailableParameterValue(String parameterName)Returns value of a single available parameter.Set<String>getAvailableRunTypeIds()Returns set of runner types available on the agentList<RunType>getAvailableRunTypes()Returns list of runners available on the agentList<String>getAvailableVcsPlugins()List<SBuildType>getBuildConfigurationsBuilt()Returns build configurations ever built on this agent.List<SFinishedBuild>getBuildHistory(User user, boolean includeCanceled)Returns the build history of this agent.Map<String,String>getBuildParameters()Returns map of build parameters that will be added to the build parameters when build is started on the agent.StringgetCommunicationProtocolDescription()Returns short description of the protocol that is used to communicate with this agent.StringgetCommunicationProtocolType()Returns type (identifier) of the protocol that is used to communicate with this agent.Map<String,String>getConfigurationParameters()Returns map of configuration parameters that are defined on the build agent.intgetCpuBenchmarkIndex()Returns this agent CPU benchmark index.intgetCpuCount()Returns the number of CPUs of this agentStringgetCurrentAgentPluginsSignature()StringgetCurrentAgentVersion()Map<String,String>getDefinedParameters()Returns map of parameters explicitly defined in the agent configuration file.StringgetHostAddress()Returns IP address or fully qualified domain name (depending on the ownAddress property in the buildAgent.properties) of the computer where build agent is runningStringgetHostName()Returns hostname of the computer where build agent is running.intgetId()Returns this agent unique idlonggetIdleTime()DategetLastCommunicationTimestamp()Returns timestamp of the last agent - server (or server - agent) successful communication.DategetLastFinishedBuildDateOnAgent(Date finishTimeAfter)Returns date of last finished build since given timeStringgetName()Returns name of the agentStringgetOperatingSystemName()Returns name of the operating system where the agent is currently running.StringgetParameterValue(String paramName)Returns value of a parameter with a given name.StringgetPingCode()StringgetPluginsSignature()Returns signature of plugins installed on the agent.<T> TgetRemoteInterface(Class<T> type)Extension point allowing to call custom methods on agent remotely.SRunningBuildgetRunningBuild()Returns the build which is currently running on the agent; null if no such build availableBuildAgentSpecialStategetSpecialState()Returns current special stateCommentgetStatusComment()Returns information about changing agent enabled/disabled status, including timestamp, user, comment textStringgetVersion()Returns agent version.voidinitAgentTypeId(int agentTypeId)Initializes agent type id in agentvoidinitAuthorized(boolean authorized)Initializes authorized status in agentvoidinitEnabled(boolean enabled)Initializes enabled status in agentbooleanisAuthorized()Returns true if agent is authorized by administrator.booleanisCaseInsensitiveEnvironment()booleanisCloudAgent()booleanisEnabled()Returns true if agent is enabled.booleanisFakeAgent()Usually running builds have some agent, but sometimes this is not the case (composite build).voidisLocal(Action<Boolean> callback)Calls callback with true if this agent is local for sure (i.e.BooleanisLocalFast()Returns the result ofBuildAgentEx.isLocal(Action)if the operation is fast, null otherwisebooleanisOutdated()Returns true if version of this agent does not match version of the server.booleanisPluginsOutdated()Returns true if some of the agent plugins are outdated.booleanisRemoved()booleanisUpgrading()Returns true if agent is upgradingvoidmarkAsRemoved()Marks the agent as removed.voidregister()Makes this agent registered.voidreleaseSources()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.voidreleaseSources(SBuildType buildType)Releases sources of the specified build configuration on this agent.booleanrestoreAgent()Restores this agent data from the database.voidsetAgentTypeId(int agentTypeId)Set agent type id to the instance of the agent.voidsetAuthorizationToken(String agentAuthorizationToken)voidsetAuthorized(boolean authorized, SUser user, String reason)Changes this agent authorization status.voidsetCommunicationTimestamp(Date timestamp)Updates agent - server binding timestamp and persists it in database if current node is allowed to do thatvoidsetEnabled(boolean enabled, SUser user, String reason)Changes this agent enabled status.voidsetEnabled(boolean enabled, SUser user, String reason, long statusRestoringTimestamp)Changes this agent enabled status and restores it in the specified time.voidsetHostAddress(String addr)voidsetHostAddress(String addr, String hostName)voidsetId(int id)voidsetName(String name)Sets new name to the agent.protected voidsetNameInternal(String name)voidsetPingCode(String pingCode)voidsetPluginsSignature(String pluginsSignature)voidsetUpgrading(boolean isUpgrading)Changes agent upgrading status.voidsetVersion(String version)voidsetVersion(String version, String pluginsSignature)booleanstopBuild(SRunningBuild build)Sends stop build command to agent.StringtoString()voidunregister(String unregistrationReason)Makes this agent unregistered.voidupdateAgent()Assuming that some other node can change agent information in database, this method reloads agent fields from database.voidupdateCommunicationTimestampInMemory(Date timestamp)Updates agent - server binding timestamp in memory, does not persists it in database-
Methods inherited from class jetbrains.buildServer.serverSide.impl.agent.AbstractBuildAgentContext
getAgentDescription, setAgentDescription
-
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
-
Methods inherited from interface jetbrains.buildServer.serverSide.BuildAgentEx
getConnection, isAccessible, runBuild, setAgentDescription, trySetSpecialState, upgrade
-
Methods inherited from interface jetbrains.buildServer.serverSide.SBuildAgent
getPort, getRegistrationTimestamp, getUnregistrationComment, isRegistered, ping
-
-
-
-
Field Detail
-
FAILED_TO_FIND_AGENT_TYPE_FOR_AGENT_MSG_PREFIX
public static final String FAILED_TO_FIND_AGENT_TYPE_FOR_AGENT_MSG_PREFIX
- See Also:
- Constant Field Values
-
-
Constructor Detail
-
AbstractBuildAgent
public AbstractBuildAgent(@NotNull AgentDescription description, @NotNull String authorizationToken, @NotNull AgentContext context, @NotNull CurrentAgentVersionProvider currentAgentVersionProvider)
-
-
Method Detail
-
initEnabled
public void initEnabled(boolean enabled)
Description copied from interface:BuildAgentInitInitializes enabled status in agent- Specified by:
initEnabledin interfaceBuildAgentInit- Parameters:
enabled- true if agent is enabled
-
initAuthorized
public void initAuthorized(boolean authorized)
Description copied from interface:BuildAgentInitInitializes authorized status in agent- Specified by:
initAuthorizedin interfaceBuildAgentInit
-
initAgentTypeId
public void initAgentTypeId(int agentTypeId)
Description copied from interface:BuildAgentInitInitializes agent type id in agent- Specified by:
initAgentTypeIdin interfaceBuildAgentInit
-
getAuthorizationToken
@NotNull public String getAuthorizationToken()
Description copied from interface:SBuildAgentReturns agent token which should be used to authorize build agent- Specified by:
getAuthorizationTokenin interfaceSBuildAgent- Returns:
- agent token which should be used to authorize build agent
-
setAuthorizationToken
public void setAuthorizationToken(@NotNull String agentAuthorizationToken)- Specified by:
setAuthorizationTokenin interfaceBuildAgentInit
-
getAgentTypeId
public int getAgentTypeId()
Description copied from interface:SBuildAgentReturns id of this agent type. All non cloud agents have own agent type. Cloud agents can share the same agent type. For cloud agents, agent type is the same as image.- Specified by:
getAgentTypeIdin interfaceSBuildAgent- Returns:
- agent type id.
-
setAgentTypeId
public void setAgentTypeId(int agentTypeId)
Description copied from interface:BuildAgentInitSet agent type id to the instance of the agent.- Specified by:
setAgentTypeIdin interfaceBuildAgentInit- Parameters:
agentTypeId- new type id.
-
getPingCode
@NotNull public String getPingCode()
- Specified by:
getPingCodein interfaceBuildAgentEx
-
setPingCode
public void setPingCode(String pingCode)
- Specified by:
setPingCodein interfaceBuildAgentEx
-
getId
public int getId()
Description copied from interface:BuildAgentReturns this agent unique id- Specified by:
getIdin interfaceBuildAgent- Returns:
- agent unique id
-
restoreAgent
public boolean restoreAgent()
Description copied from interface:BuildAgentInitRestores this agent data from the database.- Specified by:
restoreAgentin interfaceBuildAgentInit- Returns:
- true if agent was in the database and its status was restored and false if this agent is new
-
setId
public void setId(int id)
- Specified by:
setIdin interfaceBuildAgentInit
-
getName
@NotNull public final String getName()
Description copied from interface:BuildAgentReturns name of the agent- Specified by:
getNamein interfaceBuildAgent- Returns:
- name of the agent
-
setName
public final void setName(@NotNull String name)Description copied from interface:BuildAgentInitSets new name to the agent.- Specified by:
setNamein interfaceBuildAgentInit- Parameters:
name- new name for an agent
-
setNameInternal
protected void setNameInternal(@NotNull String name)
-
setEnabled
public void setEnabled(boolean enabled, @Nullable SUser user, @NotNull String reason)Description copied from interface:SBuildAgentChanges this agent enabled status.- Specified by:
setEnabledin interfaceSBuildAgent- Parameters:
enabled- true if agent is enabled, and false otherwiseuser- user who changes the status or nullreason- reason why the status is changed
-
setEnabled
public void setEnabled(boolean enabled, @Nullable SUser user, @NotNull String reason, long statusRestoringTimestamp)Description copied from interface:SBuildAgentChanges this agent enabled status and restores it in the specified time.- Specified by:
setEnabledin interfaceSBuildAgent- Parameters:
enabled- true if agent is enabled, and false otherwiseuser- user who changes the status or nullreason- reason why the status is changedstatusRestoringTimestamp- timestamp at which agent status will be restored
-
isAuthorized
public boolean isAuthorized()
Description copied from interface:SBuildAgentReturns true if agent is authorized by administrator.- Specified by:
isAuthorizedin interfaceSBuildAgent- Returns:
- see above
- See Also:
for additional information about agent status change
-
getAuthorizeComment
@NotNull public Comment getAuthorizeComment()
Description copied from interface:SBuildAgentReturns information about changing agent authorized status, including timestamp, user, comment text- Specified by:
getAuthorizeCommentin interfaceSBuildAgent- Returns:
- see above
- See Also:
Comment,SBuildAgent.isAuthorized()
-
setAuthorized
public void setAuthorized(boolean authorized, @Nullable SUser user, @NotNull String reason) throws LicenseNotGrantedExceptionDescription copied from interface:SBuildAgentChanges this agent authorization status.- Specified by:
setAuthorizedin interfaceSBuildAgent- Parameters:
authorized- true if agent should become authorized and false otherwiseuser- user who changes the status or nullreason- reason why the status changed- Throws:
LicenseNotGrantedException- if agent cannot be authorized because there is not enough license tokens
-
isLocal
public void isLocal(Action<Boolean> callback)
Description copied from interface:BuildAgentExCalls callback with true if this agent is local for sure (i.e. installed on the same machine as server).- Specified by:
isLocalin interfaceBuildAgentEx
-
isLocalFast
@Nullable public Boolean isLocalFast()
Description copied from interface:BuildAgentExReturns the result ofBuildAgentEx.isLocal(Action)if the operation is fast, null otherwise- Specified by:
isLocalFastin interfaceBuildAgentEx
-
getAgentType
@NotNull public SAgentType getAgentType()
- Specified by:
getAgentTypein interfaceBuildAgentEx
-
releaseSources
public void releaseSources()
Description copied from interface:SBuildAgentReleases 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.- Specified by:
releaseSourcesin interfaceSBuildAgent
-
releaseSources
public void releaseSources(@NotNull SBuildType buildType)Description copied from interface:SBuildAgentReleases 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.- Specified by:
releaseSourcesin interfaceSBuildAgent- Parameters:
buildType- build configuration
-
getBuildConfigurationsBuilt
@NotNull public List<SBuildType> getBuildConfigurationsBuilt()
Description copied from interface:SBuildAgentReturns build configurations ever built on this agent.- Specified by:
getBuildConfigurationsBuiltin interfaceSBuildAgent- Returns:
- see above
-
getAgentStatusToRestore
@Nullable public Boolean getAgentStatusToRestore()
Description copied from interface:SBuildAgentReturns null if agent status will not be restored, otherwise returns status to restore- Specified by:
getAgentStatusToRestorein interfaceSBuildAgent- Returns:
- null if agent status will not be restored, otherwise returns status to restore
-
getAgentStatusRestoringTimestamp
@Nullable public Date getAgentStatusRestoringTimestamp()
Description copied from interface:SBuildAgentReturns null if agent status will not be restored, otherwise returns status restoring timestamp- Specified by:
getAgentStatusRestoringTimestampin interfaceSBuildAgent- Returns:
- null if agent status will not be restored, otherwise returns status restoring timestamp
-
getBuildHistory
@NotNull public List<SFinishedBuild> getBuildHistory(@Nullable User user, boolean includeCanceled)
Description copied from interface:AgentBuildHistoryReturns the build history of this agent.The history can be filtered by user, as well as by cancelled builds.
- Specified by:
getBuildHistoryin interfaceAgentBuildHistory- Parameters:
user- if set the result will contain only builds byuserincludeCanceled- if set the result will include canceled builds as well- Returns:
- build history
-
isEnabled
public boolean isEnabled()
Description copied from interface:SBuildAgentReturns true if agent is enabled.- Specified by:
isEnabledin interfaceBuildAgent- Specified by:
isEnabledin interfaceSBuildAgent- Returns:
- true if agent is enabled.
- See Also:
for additional information about agent status change
-
getStatusComment
@NotNull public Comment getStatusComment()
Description copied from interface:SBuildAgentReturns information about changing agent enabled/disabled status, including timestamp, user, comment text- Specified by:
getStatusCommentin interfaceSBuildAgent- Returns:
- see above
- See Also:
Comment,SBuildAgent.isEnabled()
-
getRunningBuild
@Nullable public SRunningBuild getRunningBuild()
Description copied from interface:SBuildAgentReturns the build which is currently running on the agent; null if no such build available- Specified by:
getRunningBuildin interfaceSBuildAgent- Returns:
- the build which is currently running on the agent; null if no such build available
-
isUpgrading
public boolean isUpgrading()
Description copied from interface:BuildAgentReturns true if agent is upgrading- Specified by:
isUpgradingin interfaceBuildAgent- Returns:
- true if agent is upgrading
-
setUpgrading
public void setUpgrading(boolean isUpgrading)
Description copied from interface:BuildAgentExChanges agent upgrading status. Note that this method does not initiate upgrade. To initiate upgrade useBuildAgentEx.upgrade(Action)method.- Specified by:
setUpgradingin interfaceBuildAgentEx- Parameters:
isUpgrading- agent upgrade status
-
register
public void register()
Description copied from interface:BuildAgentExMakes this agent registered.- Specified by:
registerin interfaceBuildAgentEx
-
unregister
public void unregister(@NotNull String unregistrationReason)Description copied from interface:BuildAgentExMakes this agent unregistered.- Specified by:
unregisterin interfaceBuildAgentEx- Parameters:
unregistrationReason- reason of the agent unregistration
-
getVersion
@NotNull public String getVersion()
Description copied from interface:SBuildAgentReturns agent version.- Specified by:
getVersionin interfaceSBuildAgent- Returns:
- agent version
-
setVersion
public void setVersion(String version)
-
getPluginsSignature
@NotNull public String getPluginsSignature()
Description copied from interface:SBuildAgentReturns 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.- Specified by:
getPluginsSignaturein interfaceSBuildAgent- Returns:
- signature of plugins installed on the agent.
-
setPluginsSignature
public void setPluginsSignature(String pluginsSignature)
-
getCurrentAgentVersion
@NotNull public String getCurrentAgentVersion()
- Specified by:
getCurrentAgentVersionin interfaceBuildAgentEx- Returns:
- current agent version, i.e. version which corresponds to a fully updated agent
-
getCurrentAgentPluginsSignature
@NotNull public String getCurrentAgentPluginsSignature()
- Specified by:
getCurrentAgentPluginsSignaturein interfaceBuildAgentEx- Returns:
- current plugins signature, i.e. a signature which corresponds to a fully updated agent
-
buildStartedOnAgent
public void buildStartedOnAgent(@NotNull SRunningBuild build)Description copied from interface:BuildAgentExCalled when a new build is started on this agent- Specified by:
buildStartedOnAgentin interfaceBuildAgentEx
-
isOutdated
public boolean isOutdated()
Description copied from interface:SBuildAgentReturns true if version of this agent does not match version of the server.- Specified by:
isOutdatedin interfaceSBuildAgent- Returns:
- see above
-
isPluginsOutdated
public boolean isPluginsOutdated()
Description copied from interface:SBuildAgentReturns true if some of the agent plugins are outdated.- Specified by:
isPluginsOutdatedin interfaceSBuildAgent- Returns:
- see above
-
stopBuild
public boolean stopBuild(@NotNull SRunningBuild build)Description copied from interface:BuildAgentExSends stop build command to agent.- Specified by:
stopBuildin interfaceBuildAgentEx- Returns:
- true if build was stopped on agent and false otherwise
-
getRemoteInterface
public <T> T getRemoteInterface(@NotNull Class<T> type)Description copied from interface:BuildAgentExExtension point allowing to call custom methods on agent remotely.- Specified by:
getRemoteInterfacein interfaceBuildAgentEx- Parameters:
type- should contain only simple methods - with simple parameters and return types (number and strings)
-
updateAgent
public void updateAgent()
Description copied from interface:BuildAgentExAssuming that some other node can change agent information in database, this method reloads agent fields from database.- Specified by:
updateAgentin interfaceBuildAgentEx
-
isFakeAgent
public boolean isFakeAgent()
Description copied from interface:BuildAgentExUsually running builds have some agent, but sometimes this is not the case (composite build). To avoid returning null in such cases and make other code work properly a fake agent is created.- Specified by:
isFakeAgentin interfaceBuildAgentEx- Returns:
- true if this agent is a fake, not real agent.
-
getCommunicationProtocolDescription
@NotNull public String getCommunicationProtocolDescription()
Description copied from interface:SBuildAgentReturns short description of the protocol that is used to communicate with this agent.
Examples: "unidirectional", "local".- Specified by:
getCommunicationProtocolDescriptionin interfaceSBuildAgent
-
getCommunicationProtocolType
@NotNull public String getCommunicationProtocolType()
Description copied from interface:SBuildAgentReturns type (identifier) of the protocol that is used to communicate with this agent. Opposite toSBuildAgent.getCommunicationProtocolDescription()this type is constant and will not change for the particular protocol in future.- Specified by:
getCommunicationProtocolTypein interfaceSBuildAgent
-
getHostName
public String getHostName()
Description copied from interface:SBuildAgentReturns hostname of the computer where build agent is running. If server is unable to resolve agent address to host name the address is returned.- Specified by:
getHostNamein interfaceSBuildAgent- Returns:
- Returns hostname of the computer where build agent is running
-
getHostAddress
public String getHostAddress()
Description copied from interface:SBuildAgentReturns IP address or fully qualified domain name (depending on the ownAddress property in the buildAgent.properties) of the computer where build agent is running- Specified by:
getHostAddressin interfaceSBuildAgent- Returns:
- see above
-
setHostAddress
public void setHostAddress(String addr)
-
compareTo
public int compareTo(@NotNull BuildAgent agent)- Specified by:
compareToin interfaceComparable<BuildAgent>
-
generateUniqueAgentAuthorizationToken
public void generateUniqueAgentAuthorizationToken()
Description copied from interface:BuildAgentInitGenerates new agent authorization token for this agent. It is guaranteed that the new authorization token is unique among the all agents in the database.- Specified by:
generateUniqueAgentAuthorizationTokenin interfaceBuildAgentInit
-
getLastCommunicationTimestamp
public Date getLastCommunicationTimestamp()
Description copied from interface:SBuildAgentReturns timestamp of the last agent - server (or server - agent) successful communication.- Specified by:
getLastCommunicationTimestampin interfaceSBuildAgent- Returns:
- see above
-
setCommunicationTimestamp
public void setCommunicationTimestamp(@NotNull Date timestamp)Description copied from interface:BuildAgentExUpdates agent - server binding timestamp and persists it in database if current node is allowed to do that- Specified by:
setCommunicationTimestampin interfaceBuildAgentEx- Parameters:
timestamp- timestamp
-
updateCommunicationTimestampInMemory
public void updateCommunicationTimestampInMemory(@NotNull Date timestamp)Description copied from interface:BuildAgentExUpdates agent - server binding timestamp in memory, does not persists it in database- Specified by:
updateCommunicationTimestampInMemoryin interfaceBuildAgentEx
-
getIdleTime
public long getIdleTime()
- Specified by:
getIdleTimein interfaceSBuildAgent- 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.
-
getLastFinishedBuildDateOnAgent
@Nullable public Date getLastFinishedBuildDateOnAgent(@NotNull Date finishTimeAfter)
Description copied from interface:BuildAgentExReturns date of last finished build since given time- Specified by:
getLastFinishedBuildDateOnAgentin interfaceBuildAgentEx- Parameters:
finishTimeAfter- finish time lower bound- Returns:
-
isRemoved
public boolean isRemoved()
- Specified by:
isRemovedin interfaceBuildAgentEx- Returns:
- true if this agent is removed
-
markAsRemoved
public void markAsRemoved()
Description copied from interface:BuildAgentExMarks the agent as removed.- Specified by:
markAsRemovedin interfaceBuildAgentEx
-
getAvailableRunTypes
@NotNull public final List<RunType> getAvailableRunTypes()
Description copied from interface:AgentDescriptionReturns list of runners available on the agent- Specified by:
getAvailableRunTypesin interfaceAgentDescription- Returns:
- list of runners ordered by display name
-
getAvailableRunTypeIds
@NotNull public Set<String> getAvailableRunTypeIds()
Description copied from interface:AgentDescriptionReturns set of runner types available on the agent- Specified by:
getAvailableRunTypeIdsin interfaceAgentDescription- Returns:
- set of runner types
-
getAvailableVcsPlugins
@NotNull public final List<String> getAvailableVcsPlugins()
- Specified by:
getAvailableVcsPluginsin interfaceAgentDescription
-
getOperatingSystemName
@NotNull public final String getOperatingSystemName()
Description copied from interface:AgentDescriptionReturns name of the operating system where the agent is currently running.- Specified by:
getOperatingSystemNamein interfaceAgentDescription- Returns:
- name of the operating system where the agent is currently running.
-
getCpuBenchmarkIndex
public final int getCpuBenchmarkIndex()
Description copied from interface:BuildAgentReturns this agent CPU benchmark index. The higher this value the more powerful agent CPU.- Specified by:
getCpuBenchmarkIndexin interfaceAgentDescription- Specified by:
getCpuBenchmarkIndexin interfaceBuildAgent- Returns:
- CPU index or -1 if index is not available
-
getCpuCount
public int getCpuCount()
Description copied from interface:BuildAgentReturns the number of CPUs of this agent- Specified by:
getCpuCountin interfaceAgentDescription- Specified by:
getCpuCountin interfaceBuildAgent- Returns:
- number of CPUs or -1 if count is not available
-
getAvailableParameters
@NotNull public final Map<String,String> getAvailableParameters()
Description copied from interface:AgentDescriptionReturns map of parameters available on the agent. These parameters include environment variables defined for the agent process as well as parameters defined in the agent configuration file.- Specified by:
getAvailableParametersin interfaceAgentDescription- Returns:
- see above
-
getAvailableParameterValue
@Nullable public String getAvailableParameterValue(@NotNull String parameterName)
Description copied from interface:AgentDescriptionReturns value of a single available parameter. This is equivalent to {@link #getAvailableParameters().get(name)} but can work faster.- Specified by:
getAvailableParameterValuein interfaceAgentDescription- Parameters:
parameterName- name of the parameter- Returns:
- see above
-
getDefinedParameters
@NotNull public final Map<String,String> getDefinedParameters()
Description copied from interface:AgentDescriptionReturns map of parameters explicitly defined in the agent configuration file.- Specified by:
getDefinedParametersin interfaceAgentDescription- Returns:
- see above
-
getBuildParameters
@NotNull public final Map<String,String> getBuildParameters()
Description copied from interface:AgentDescriptionReturns map of build parameters that will be added to the build parameters when build is started on the agent. Keys in the map have prefixesConstants.SYSTEM_PREFIXorConstants.ENV_PREFIX- Specified by:
getBuildParametersin interfaceAgentDescription- Returns:
- map of build parameters.
-
getConfigurationParameters
@NotNull public final Map<String,String> getConfigurationParameters()
Description copied from interface:AgentDescriptionReturns map of configuration parameters that are defined on the build agent. Those parameters may be defined in agent configuration files or may be provided by agent plugins.- Specified by:
getConfigurationParametersin interfaceAgentDescription- Returns:
- map of parameters
-
getParameterValue
@Nullable public String getParameterValue(@NotNull String paramName)
Description copied from interface:BuildAgentExReturns value of a parameter with a given name. This method can access all agent parameters, including those which should not be exposed in the UI. The method can only be called by an authority with system admin like permission.- Specified by:
getParameterValuein interfaceBuildAgentEx- Parameters:
paramName- parameter name- Returns:
- see above
-
isCaseInsensitiveEnvironment
public boolean isCaseInsensitiveEnvironment()
- Specified by:
isCaseInsensitiveEnvironmentin interfaceAgentDescription- Returns:
- true if names of environment variables are case insensitive
-
describe
@NotNull public String describe(boolean verbose)
- Specified by:
describein interfaceLoggable- Specified by:
describein interfaceSBuildAgent- Parameters:
verbose- verbosity of object description- Returns:
- description of this object. If verbose is true, description should have mode details.
-
getAgentPoolId
public int getAgentPoolId()
Description copied from interface:BuildAgentReturns the pool id the agent belongs to.
- Specified by:
getAgentPoolIdin interfaceBuildAgent- Returns:
- agent pool id the agent belongs to
-
getAgentPool
@NotNull public AgentPool getAgentPool()
- Specified by:
getAgentPoolin interfaceSBuildAgent- Returns:
- agent pool agent belongs to
-
isCloudAgent
public boolean isCloudAgent()
- Specified by:
isCloudAgentin interfaceSBuildAgent- Returns:
- true if this agent is started by TeamCity cloud integration
-
canStartBuildIfAgentOutdated
public boolean canStartBuildIfAgentOutdated()
- Specified by:
canStartBuildIfAgentOutdatedin interfaceSBuildAgent- Returns:
- true if agent can start builds even if the agent is outdated
-
clearSpecialState
public void clearSpecialState(BuildAgentSpecialState specialState)
Description copied from interface:BuildAgentExClears special state if set to the given value- Specified by:
clearSpecialStatein interfaceBuildAgentEx
-
getSpecialState
public BuildAgentSpecialState getSpecialState()
Description copied from interface:BuildAgentExReturns current special state- Specified by:
getSpecialStatein interfaceBuildAgentEx- Returns:
- see above
-
-