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 String
NA
static String
NAME
-
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 void
generateUniqueAgentAuthorizationToken()
Generates new agent authorization token for this agent.SAgentType
getAgentType()
String
getAuthorizationToken()
Returns agent token which should be used to authorize build agentRemoteAgentConnection
getConnection()
String
getHostAddress()
Returns IP address or fully qualified domain name (depending on the ownAddress property in the buildAgent.properties) of the computer where build agent is runningString
getHostName()
Returns hostname of the computer where build agent is running.String
getPluginsSignature()
Returns signature of plugins installed on the agent.int
getPort()
Port where agent is listening for server commands.Date
getRegistrationTimestamp()
Returns timestamp of this agent registration.String
getUnregistrationComment()
If agent is not registered returns reason of its' unregistration.String
getVersion()
Returns agent version.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 networksboolean
restoreAgent()
Restores this agent data from the database.AgentBuildResult
runBuild(AgentBuild agentBuild)
Send runBuild command to the Agent.void
setAgentTypeId(int agentTypeId)
Set agent type id to the instance of the agent.void
setAuthorizationToken(String agentAuthorizationToken)
boolean
upgrade(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:BuildAgentInit
Set agent type id to the instance of the agent.- Specified by:
setAgentTypeId
in interfaceBuildAgentInit
- Overrides:
setAgentTypeId
in classAbstractBuildAgent
- Parameters:
agentTypeId
- new type id.
-
getAgentType
@NotNull public SAgentType getAgentType()
- Specified by:
getAgentType
in interfaceBuildAgentEx
- Overrides:
getAgentType
in classAbstractBuildAgent
-
runBuild
public AgentBuildResult runBuild(@NotNull AgentBuild agentBuild)
Description copied from interface:BuildAgentEx
Send runBuild command to the Agent.
-
upgrade
public boolean upgrade(Action<Boolean> callback)
Description copied from interface:BuildAgentEx
Sends 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:SBuildAgent
Returns agent version.- Specified by:
getVersion
in interfaceSBuildAgent
- Overrides:
getVersion
in classAbstractBuildAgent
- Returns:
- agent version
-
getPluginsSignature
@NotNull public String getPluginsSignature()
Description copied from interface:SBuildAgent
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.- Specified by:
getPluginsSignature
in interfaceSBuildAgent
- Overrides:
getPluginsSignature
in classAbstractBuildAgent
- Returns:
- signature of plugins installed on the agent.
-
getHostName
public String getHostName()
Description copied from interface:SBuildAgent
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.- Specified by:
getHostName
in interfaceSBuildAgent
- Overrides:
getHostName
in classAbstractBuildAgent
- Returns:
- Returns hostname of the computer where build agent is running
-
getHostAddress
public String getHostAddress()
Description copied from interface:SBuildAgent
Returns 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:
getHostAddress
in interfaceSBuildAgent
- Overrides:
getHostAddress
in classAbstractBuildAgent
- Returns:
- see above
-
setAuthorizationToken
public void setAuthorizationToken(@NotNull String agentAuthorizationToken)
- Specified by:
setAuthorizationToken
in interfaceBuildAgentInit
- Overrides:
setAuthorizationToken
in classAbstractBuildAgent
-
getAuthorizationToken
@NotNull public String getAuthorizationToken()
Description copied from interface:SBuildAgent
Returns agent token which should be used to authorize build agent- Specified by:
getAuthorizationToken
in interfaceSBuildAgent
- Overrides:
getAuthorizationToken
in classAbstractBuildAgent
- Returns:
- agent token which should be used to authorize build agent
-
getPort
public int getPort()
Description copied from interface:SBuildAgent
Port where agent is listening for server commands.- Returns:
- see above
-
ping
public boolean ping()
Description copied from interface:SBuildAgent
Try to ping agent over networks- Returns:
- true if agent is reachable
-
isRegistered
public boolean isRegistered()
Description copied from interface:SBuildAgent
Returns 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:SBuildAgent
If 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:SBuildAgent
Returns true if version of this agent does not match version of the server.- Specified by:
isOutdated
in interfaceSBuildAgent
- Overrides:
isOutdated
in classAbstractBuildAgent
- Returns:
- see above
-
isPluginsOutdated
public boolean isPluginsOutdated()
Description copied from interface:SBuildAgent
Returns true if some of the agent plugins are outdated.- Specified by:
isPluginsOutdated
in interfaceSBuildAgent
- Overrides:
isPluginsOutdated
in classAbstractBuildAgent
- Returns:
- see above
-
getRegistrationTimestamp
@NotNull public Date getRegistrationTimestamp()
Description copied from interface:SBuildAgent
Returns 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:BuildAgentInit
Restores this agent data from the database.- Specified by:
restoreAgent
in interfaceBuildAgentInit
- Overrides:
restoreAgent
in 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:BuildAgentInit
Generates 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:
generateUniqueAgentAuthorizationToken
in interfaceBuildAgentInit
- Overrides:
generateUniqueAgentAuthorizationToken
in classAbstractBuildAgent
-
-