public interface BuildAgentManager
Modifier and Type | Interface and Description |
---|---|
static class |
BuildAgentManager.RunConfigurationPolicy
Policies to check if the is allowed to run the configuration.
|
Modifier and Type | Method and Description |
---|---|
<T extends SBuildAgent> |
findAgentById(int agentId,
boolean searchUnregistered)
Searches for an agent with specified id among registered and unregistered agents.
|
<T extends SBuildAgent> |
findAgentByName(java.lang.String agentName,
boolean searchUnregistered)
Searches for an agent with specified name among registered and unregistered agents.
|
<T extends SBuildAgent> |
getAgentCompatibilities(T agent)
Returns build configuration compatibility information for the specified agent
|
<T extends SBuildAgent> |
getCanRunConfigurations(T agent)
Returns list of build configurations this agent can potentially run.
|
<T extends SBuildAgent> |
getNumberOfCompatibleConfigurations(T agent)
Returns number of configurations compatible with specified agent
|
<T extends SBuildAgent> |
getNumberOfIncompatibleConfigurations(T agent)
Returns number of configurations incompatible with specified agent
|
<T extends SBuildAgent> |
getRegisteredAgents()
Returns all registered authorized agents.
|
<T extends SBuildAgent> |
getRegisteredAgents(boolean includeUnauthorized)
Returns all registered agents.
|
<T extends SBuildAgent> |
getRunConfigurationPolicy(T agent)
Returns run configuration policy for an agent.
|
<T extends SBuildAgent> |
getUnregisteredAgents()
Returns list of all currently unregistered and authorized agents, i.e.
|
<T extends SBuildAgent> |
getUnregisteredAgents(boolean includeUnauthorized)
Returns list of all currently unregistered agents, with additional filter based on authorization status.
|
<T extends SBuildAgent> |
isCanRunConfiguration(T agent,
BuildTypeDescriptor buildType)
Returns true if specified agent can run specified build configuration.
|
void |
removeAgent(SBuildAgent agent,
SUser user)
Removes specified agent and cleans up this agent state from the database.
|
<T extends SBuildAgent> |
setCanRunConfiguration(T agent,
java.lang.String buildTypeId,
boolean canRun)
If
BuildAgentManager.RunConfigurationPolicy.SELECTED_COMPATIBLE_CONFIGURATIONS policy is selected for the agent,
sets whether configuration with specified id can or can't run on the agent. |
<T extends SBuildAgent> |
setRunConfigurationPolicy(T agent,
BuildAgentManager.RunConfigurationPolicy policy)
Sets build configuration run policy for an agent.
|
<T extends SBuildAgent> java.util.List<T> getRegisteredAgents()
<T extends SBuildAgent> java.util.List<T> getRegisteredAgents(boolean includeUnauthorized)
includeUnauthorized
- if true, unauthorized agents, i.e. agents which cannot run builds until authorized by admin<T extends SBuildAgent> java.util.List<T> getUnregisteredAgents()
<T extends SBuildAgent> java.util.List<T> getUnregisteredAgents(boolean includeUnauthorized)
getUnregisteredAgents()
includeUnauthorized
- whether to include or exclude unauthorized agents@Nullable <T extends SBuildAgent> T findAgentById(int agentId, boolean searchUnregistered)
agentId
- id of the agent to searchsearchUnregistered
- true if unregistered agents should be searched too@Nullable <T extends SBuildAgent> T findAgentByName(java.lang.String agentName, boolean searchUnregistered)
agentName
- name of the agent to searchsearchUnregistered
- true if unregistered agents should be searched toovoid removeAgent(@NotNull SBuildAgent agent, @Nullable SUser user) throws AgentCannotBeRemovedException
agent
- agentuser
- user who removes agent (can be null)AgentCannotBeRemovedException
- if agent is connected/registered<T extends SBuildAgent> void setRunConfigurationPolicy(T agent, BuildAgentManager.RunConfigurationPolicy policy)
BuildAgentManager.RunConfigurationPolicy.ALL_COMPATIBLE_CONFIGURATIONS
- all compatible configurations can run on this agent
BuildAgentManager.RunConfigurationPolicy.SELECTED_COMPATIBLE_CONFIGURATIONS
- only selected configurations can run on this agent (configuration needs to be compatible too)
agent
- the agentpolicy
- policy to set<T extends SBuildAgent> BuildAgentManager.RunConfigurationPolicy getRunConfigurationPolicy(T agent)
agent
- the agent<T extends SBuildAgent> void setCanRunConfiguration(T agent, java.lang.String buildTypeId, boolean canRun)
BuildAgentManager.RunConfigurationPolicy.SELECTED_COMPATIBLE_CONFIGURATIONS
policy is selected for the agent,
sets whether configuration with specified id can or can't run on the agent.agent
- the agentbuildTypeId
- id of the configurationcanRun
- if true then this configuration can run on the agent, if false it can't<T extends SBuildAgent> boolean isCanRunConfiguration(T agent, BuildTypeDescriptor buildType)
agent
- the agentbuildType
- build configurationBuildAgentManager.RunConfigurationPolicy.ALL_COMPATIBLE_CONFIGURATIONS
policy selected or
configuration was explicitly marked as accessible by the agent. Please note that compatibility check is not performed.<T extends SBuildAgent> java.util.Set<java.lang.String> getCanRunConfigurations(T agent)
agent
- the agent<T extends SBuildAgent> int getNumberOfCompatibleConfigurations(T agent)
agent
- agent<T extends SBuildAgent> int getNumberOfIncompatibleConfigurations(T agent)
agent
- agent<T extends SBuildAgent> java.util.List<AgentCompatibility> getAgentCompatibilities(T agent)
agent
- agent