Class UnregisteredAgent
- 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.UnregisteredAgent
-
- All Implemented Interfaces:
Comparable<BuildAgent>,BuildAgent,Loggable,AgentBuildHistory,AgentDescription,BuildAgentEx,BuildAgentInit,SBuildAgent
public class UnregisteredAgent extends AbstractBuildAgent
User: kir
-
-
Field Summary
-
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 UnregisteredAgent(AgentContext context, AgentDescription description, AgentData data, CurrentAgentVersionProvider currentAgentVersionProvider)
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description Stringdescribe(boolean verbose)voidgenerateUniqueAgentAuthorizationToken()Generates new agent authorization token for this agent.RemoteAgentConnectiongetConnection()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.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.voidsetUpgrading(boolean isUpgrading)Changes agent upgrading status.StringtoString()booleanupgrade(Action<Boolean> callback)Sends upgrade command on agent-
Methods inherited from class jetbrains.buildServer.serverSide.impl.agent.AbstractBuildAgent
buildStartedOnAgent, canStartBuildIfAgentOutdated, clearSpecialState, compareTo, getAgentPool, getAgentPoolId, getAgentStatusRestoringTimestamp, getAgentStatusToRestore, getAgentType, getAgentTypeId, getAuthorizationToken, getAuthorizeComment, getAvailableParameters, getAvailableParameterValue, getAvailableRunTypeIds, getAvailableRunTypes, getAvailableVcsPlugins, getBuildConfigurationsBuilt, getBuildHistory, getBuildParameters, getCommunicationProtocolDescription, getCommunicationProtocolType, getConfigurationParameters, getCpuBenchmarkIndex, getCpuCount, getCurrentAgentPluginsSignature, getCurrentAgentVersion, getDefinedParameters, getHostAddress, getHostName, getId, getIdleTime, getLastCommunicationTimestamp, getLastFinishedBuildDateOnAgent, getName, getOperatingSystemName, getParameterValue, getPingCode, getPluginsSignature, getRemoteInterface, getRunningBuild, getSpecialState, getStatusComment, getVersion, initAgentTypeId, initAuthorized, initEnabled, isAuthorized, isCaseInsensitiveEnvironment, isCloudAgent, isEnabled, isFakeAgent, isLocal, isLocalFast, isRemoved, isUpgrading, markAsRemoved, register, releaseSources, releaseSources, setAuthorizationToken, setAuthorized, setCommunicationTimestamp, setEnabled, setEnabled, setHostAddress, setHostAddress, setId, setName, setNameInternal, setPingCode, setPluginsSignature, setVersion, setVersion, stopBuild, 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
-
-
-
-
Constructor Detail
-
UnregisteredAgent
public UnregisteredAgent(@NotNull AgentContext context, @NotNull AgentDescription description, @NotNull AgentData data, @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.
-
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).
-
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
-
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- Overrides:
setUpgradingin classAbstractBuildAgent- Parameters:
isUpgrading- agent upgrade status
-
getConnection
@NotNull public RemoteAgentConnection getConnection()
-
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.
-
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
-
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
-
toString
public String toString()
- Overrides:
toStringin classAbstractBuildAgent
-
describe
@NotNull public String describe(boolean verbose)
- Specified by:
describein interfaceLoggable- Specified by:
describein interfaceSBuildAgent- Overrides:
describein classAbstractBuildAgent- Parameters:
verbose- verbosity of object description- Returns:
- description of this object. If verbose is true, description should have mode details.
-
-