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 String
describe(boolean verbose)
void
generateUniqueAgentAuthorizationToken()
Generates new agent authorization token for this agent.RemoteAgentConnection
getConnection()
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.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
setUpgrading(boolean isUpgrading)
Changes agent upgrading status.String
toString()
boolean
upgrade(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: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.
-
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).
-
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
-
setUpgrading
public void setUpgrading(boolean isUpgrading)
Description copied from interface:BuildAgentEx
Changes agent upgrading status. Note that this method does not initiate upgrade. To initiate upgrade useBuildAgentEx.upgrade(Action)
method.- Specified by:
setUpgrading
in interfaceBuildAgentEx
- Overrides:
setUpgrading
in classAbstractBuildAgent
- Parameters:
isUpgrading
- agent upgrade status
-
getConnection
@NotNull public RemoteAgentConnection getConnection()
-
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.
-
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
-
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
-
toString
public String toString()
- Overrides:
toString
in classAbstractBuildAgent
-
describe
@NotNull public String describe(boolean verbose)
- Specified by:
describe
in interfaceLoggable
- Specified by:
describe
in interfaceSBuildAgent
- Overrides:
describe
in classAbstractBuildAgent
- Parameters:
verbose
- verbosity of object description- Returns:
- description of this object. If verbose is true, description should have mode details.
-
-