Package jetbrains.buildServer.serverSide
Interface BuildAgentInit
-
- All Known Subinterfaces:
BuildAgentEx
- All Known Implementing Classes:
AbstractBuildAgent
,AbstractBuildAgentContext
,DeadAgent
,MockBuildAgent
,RegisteredAgent
,SecuredBuildAgent
,UnregisteredAgent
public interface BuildAgentInit
Contains methods called during build agent initialization
-
-
Method Summary
All Methods Instance Methods Abstract Methods Modifier and Type Method Description void
generateUniqueAgentAuthorizationToken()
Generates new agent authorization token for this agent.void
initAgentTypeId(int agentTypeId)
Initializes agent type id in agentvoid
initAuthorized(boolean authorized)
Initializes authorized status in agentvoid
initEnabled(boolean enabled)
Initializes enabled status in agentboolean
restoreAgent()
Restores this agent data from the database.void
setAgentTypeId(int agentTypeId)
Set agent type id to the instance of the agent.void
setAuthorizationToken(String agentAuthorizationToken)
void
setId(int id)
void
setName(String name)
Sets new name to the agent.
-
-
-
Method Detail
-
restoreAgent
boolean restoreAgent()
Restores this agent data from the database.- Returns:
- true if agent was in the database and its status was restored and false if this agent is new
- Throws:
UnsupportedOperationException
- if this agent does not support restoring from the database
-
setId
void setId(int id)
-
setAgentTypeId
void setAgentTypeId(int agentTypeId)
Set agent type id to the instance of the agent.- Parameters:
agentTypeId
- new type id.
-
setAuthorizationToken
void setAuthorizationToken(@NotNull String agentAuthorizationToken)
-
generateUniqueAgentAuthorizationToken
void generateUniqueAgentAuthorizationToken()
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.
-
setName
void setName(@NotNull String name) throws IllegalStateException
Sets new name to the agent.- Parameters:
name
- new name for an agent- Throws:
IllegalStateException
- if it failed to update name
-
initEnabled
void initEnabled(boolean enabled)
Initializes enabled status in agent- Parameters:
enabled
- true if agent is enabled
-
initAuthorized
void initAuthorized(boolean authorized)
Initializes authorized status in agent- Parameters:
enabled
- true if agent is authorized
-
initAgentTypeId
void initAgentTypeId(int agentTypeId)
Initializes agent type id in agent
-
-