Class DeadAgent
- java.lang.Object
-
- jetbrains.buildServer.serverSide.impl.Proxyfied<BuildAgentEx>
-
- jetbrains.buildServer.serverSide.impl.agent.AbstractBuildAgentContext
-
- jetbrains.buildServer.serverSide.impl.agent.AbstractBuildAgent
-
- jetbrains.buildServer.serverSide.impl.agent.DeadAgent
-
- All Implemented Interfaces:
Comparable<BuildAgent>,BuildAgent,Loggable,AgentBuildHistory,AgentDescription,BuildAgentEx,BuildAgentInit,SBuildAgent
public class DeadAgent extends AbstractBuildAgent
User: kir
-
-
Field Summary
Fields Modifier and Type Field Description static StringNAstatic StringNAME-
Fields inherited from class jetbrains.buildServer.serverSide.impl.agent.AbstractBuildAgent
FAILED_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 DeadAgent(AgentContext context, AgentDescription description, int agentId, int agentTypeId, CurrentAgentVersionProvider currentAgentVersionProvider)DeadAgent(AgentContext context, AgentDescription description, String agentName, int agentTypeId, CurrentAgentVersionProvider currentAgentVersionProvider)
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description voidgenerateUniqueAgentAuthorizationToken()Generates new agent authorization token for this agent.SAgentTypegetAgentType()StringgetAuthorizationToken()Returns agent token which should be used to authorize build agentRemoteAgentConnectiongetConnection()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.StringgetPluginsSignature()Returns signature of plugins installed on the agent.intgetPort()Port where agent is listening for server commands.DategetRegistrationTimestamp()Returns timestamp of this agent registration.StringgetUnregistrationComment()If agent is not registered returns reason of its' unregistration.StringgetVersion()Returns agent version.booleanisOutdated()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.booleanisRegistered()Returns true or false depending on whether this agent is currently registered on server or not.booleanping()Try to ping agent over networksbooleanrestoreAgent()Restores this agent data from the database.AgentBuildResultrunBuild(AgentBuild agentBuild)Send runBuild command to the Agent.voidsetAgentTypeId(int agentTypeId)Set agent type id to the instance of the agent.voidsetAuthorizationToken(String agentAuthorizationToken)booleanupgrade(Action<Boolean> callback)Sends upgrade command on agent-
Methods inherited from class jetbrains.buildServer.serverSide.impl.agent.AbstractBuildAgent
buildStartedOnAgent, canStartBuildIfAgentOutdated, clearSpecialState, compareTo, describe, getAgentPool, getAgentPoolId, getAgentStatusRestoringTimestamp, getAgentStatusToRestore, getAgentTypeId, getAuthorizeComment, getAvailableParameters, getAvailableParameterValue, getAvailableRunTypeIds, getAvailableRunTypes, getAvailableVcsPlugins, getBuildConfigurationsBuilt, getBuildHistory, getBuildParameters, getCommunicationProtocolDescription, getCommunicationProtocolType, getConfigurationParameters, getCpuBenchmarkIndex, getCpuCount, getCurrentAgentPluginsSignature, getCurrentAgentVersion, getDefinedParameters, getId, getIdleTime, getLastCommunicationTimestamp, getLastFinishedBuildDateOnAgent, getName, getOperatingSystemName, getParameterValue, getPingCode, getRemoteInterface, getRunningBuild, getSpecialState, getStatusComment, initAgentTypeId, initAuthorized, initEnabled, isAuthorized, isCaseInsensitiveEnvironment, isCloudAgent, isEnabled, isFakeAgent, isLocal, isLocalFast, isRemoved, isUpgrading, markAsRemoved, register, releaseSources, releaseSources, setAuthorized, setCommunicationTimestamp, setEnabled, setEnabled, setHostAddress, setHostAddress, setId, setName, setNameInternal, setPingCode, setPluginsSignature, setUpgrading, setVersion, setVersion, stopBuild, toString, unregister, updateAgent, updateCommunicationTimestampInMemory
-
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
isAccessible, setAgentDescription, trySetSpecialState
-
-
-
-
Field Detail
-
NAME
public static final String NAME
- See Also:
- Constant Field Values
-
NA
public static final String NA
- See Also:
- Constant Field Values
-
-
Constructor Detail
-
DeadAgent
public DeadAgent(@NotNull AgentContext context, @NotNull AgentDescription description, int agentId, int agentTypeId, @NotNull CurrentAgentVersionProvider currentAgentVersionProvider)
-
DeadAgent
public DeadAgent(@NotNull AgentContext context, @NotNull AgentDescription description, String agentName, int agentTypeId, @NotNull CurrentAgentVersionProvider currentAgentVersionProvider)
-
-
Method Detail
-
setAgentTypeId
public void setAgentTypeId(int agentTypeId)
Description copied from interface:BuildAgentInitSet agent type id to the instance of the agent.- Specified by:
setAgentTypeIdin interfaceBuildAgentInit- Overrides:
setAgentTypeIdin classAbstractBuildAgent- Parameters:
agentTypeId- new type id.
-
getAgentType
@NotNull public SAgentType getAgentType()
- Specified by:
getAgentTypein interfaceBuildAgentEx- Overrides:
getAgentTypein classAbstractBuildAgent
-
runBuild
public AgentBuildResult runBuild(@NotNull AgentBuild agentBuild)
Description copied from interface:BuildAgentExSend runBuild command to the Agent.
-
upgrade
public boolean upgrade(Action<Boolean> callback)
Description copied from interface:BuildAgentExSends upgrade command on agent- Parameters:
callback- will be called with true if upgrade was accepted by agent.- Returns:
- true if upgrade is scheduled, false otherwise (for example if previous Upgrade call is still in progress).
-
getConnection
@NotNull public RemoteAgentConnection getConnection()
-
getVersion
@NotNull public String getVersion()
Description copied from interface:SBuildAgentReturns agent version.- Specified by:
getVersionin interfaceSBuildAgent- Overrides:
getVersionin classAbstractBuildAgent- Returns:
- agent 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- Overrides:
getPluginsSignaturein classAbstractBuildAgent- Returns:
- signature of plugins installed on the agent.
-
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- Overrides:
getHostNamein classAbstractBuildAgent- 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- Overrides:
getHostAddressin classAbstractBuildAgent- Returns:
- see above
-
setAuthorizationToken
public void setAuthorizationToken(@NotNull String agentAuthorizationToken)- Specified by:
setAuthorizationTokenin interfaceBuildAgentInit- Overrides:
setAuthorizationTokenin classAbstractBuildAgent
-
getAuthorizationToken
@NotNull public String getAuthorizationToken()
Description copied from interface:SBuildAgentReturns agent token which should be used to authorize build agent- Specified by:
getAuthorizationTokenin interfaceSBuildAgent- Overrides:
getAuthorizationTokenin classAbstractBuildAgent- Returns:
- agent token which should be used to authorize build agent
-
getPort
public int getPort()
Description copied from interface:SBuildAgentPort where agent is listening for server commands.- Returns:
- see above
-
ping
public boolean ping()
Description copied from interface:SBuildAgentTry to ping agent over networks- Returns:
- true if agent is reachable
-
isRegistered
public boolean isRegistered()
Description copied from interface:SBuildAgentReturns true or false depending on whether this agent is currently registered on server or not.- Returns:
- see above
-
getUnregistrationComment
public String getUnregistrationComment()
Description copied from interface:SBuildAgentIf agent is not registered returns reason of its' unregistration.- Returns:
- agent is not registered returns reason of its' unregistration.
-
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- Overrides:
isOutdatedin classAbstractBuildAgent- 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- Overrides:
isPluginsOutdatedin classAbstractBuildAgent- Returns:
- see above
-
getRegistrationTimestamp
@NotNull public Date getRegistrationTimestamp()
Description copied from interface:SBuildAgentReturns timestamp of this agent registration. If agent is not registered the returned timestamp is timestamp of last agent registration.- Returns:
- see above
-
restoreAgent
public boolean restoreAgent()
Description copied from interface:BuildAgentInitRestores this agent data from the database.- Specified by:
restoreAgentin interfaceBuildAgentInit- Overrides:
restoreAgentin classAbstractBuildAgent- Returns:
- true if agent was in the database and its status was restored and false if this agent is new
-
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- Overrides:
generateUniqueAgentAuthorizationTokenin classAbstractBuildAgent
-
-