Class BuildExecutorsManagerImpl
- java.lang.Object
-
- jetbrains.buildServer.clouds.server.impl.executors.BuildExecutorsManagerImpl
-
- All Implemented Interfaces:
BuildExecutorsManager
public class BuildExecutorsManagerImpl extends Object implements BuildExecutorsManager
-
-
Constructor Summary
Constructors Constructor Description BuildExecutorsManagerImpl(ExtensionHolder extensionHolder, ProjectManager projectManager)
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description BuildExecutorDescriptor
addExecutor(SProject project, Map<String,String> parameters, String executorType)
Adds a new executor to the specified project.BuildExecutorDescriptor
addExecutor(SProject project, Map<String,String> parameters, BuildExecutorType executorType)
Adds a new executor to the specified project.BuildExecutorDescriptor
findExecutorById(SProject project, String executorId)
Searches for executor by id starting with specified project.BuildExecutorType
findExecutorType(String type)
Finds the BuildExecutorType with the specified type.Collection<BuildExecutorDescriptor>
getAllExecutors()
Retrieves all build executors available in the system.List<BuildExecutorDescriptor>
getAvailableExecutors(SProject project)
Returns own project executor and all connections from parent projects.List<BuildExecutorDescriptor>
getAvailableExecutorsOfType(SProject project, String executorType)
Returns all executors of specified type available for current project.Collection<BuildExecutorType>
getExecutorTypes()
List<BuildExecutorDescriptor>
getOwnAvailableExecutors(SProject project)
Returns own project executorsList<BuildExecutorDescriptor>
getOwnAvailableExecutors(SProject project, boolean includeSubprojects)
Retrieves a list of available build executors for the specified project.boolean
isExecutorEnabled(SProject project, String executorId)
void
removeExecutor(SProject project, String executorId)
Removes a build executor with the specified executorId from the given project.void
setExecutorEnabled(SProject project, String executorId, boolean enabled)
boolean
updateExecutor(SProject project, String executorId, String executorType, Map<String,String> parameters)
Updates the executor with the specified executorId and providerType in the given project with the provided parameters.
-
-
-
Constructor Detail
-
BuildExecutorsManagerImpl
public BuildExecutorsManagerImpl(@NotNull ExtensionHolder extensionHolder, @NotNull ProjectManager projectManager)
-
-
Method Detail
-
findExecutorById
@Nullable public BuildExecutorDescriptor findExecutorById(@NotNull SProject project, @NotNull String executorId)
Description copied from interface:BuildExecutorsManager
Searches for executor by id starting with specified project. Search is performed in specified projects and all its parents until the first executor with the ID is found.- Specified by:
findExecutorById
in interfaceBuildExecutorsManager
- Parameters:
project
- project to start withexecutorId
- id of the executor- Returns:
- the first found executor or null
-
getAvailableExecutorsOfType
@NotNull public List<BuildExecutorDescriptor> getAvailableExecutorsOfType(@NotNull SProject project, @NotNull String executorType)
Description copied from interface:BuildExecutorsManager
Returns all executors of specified type available for current project. These include own project executors and all executors from parent projects.- Specified by:
getAvailableExecutorsOfType
in interfaceBuildExecutorsManager
- Parameters:
project
- current projectexecutorType
- type of theBuildExecutorType
- Returns:
- all found connections in the project hierarchy order: firstly connections from the specified project, then all connections from parent projects.
-
getAvailableExecutors
@NotNull public List<BuildExecutorDescriptor> getAvailableExecutors(@NotNull SProject project)
Description copied from interface:BuildExecutorsManager
Returns own project executor and all connections from parent projects.- Specified by:
getAvailableExecutors
in interfaceBuildExecutorsManager
- Parameters:
project
- current project- Returns:
- all connections in the project hierarchy order: firstly connections from the specified project, then all connections from parent projects.
-
getOwnAvailableExecutors
@NotNull public List<BuildExecutorDescriptor> getOwnAvailableExecutors(@NotNull SProject project)
Description copied from interface:BuildExecutorsManager
Returns own project executors- Specified by:
getOwnAvailableExecutors
in interfaceBuildExecutorsManager
- Parameters:
project
- current project- Returns:
- a list of build executor descriptors available for the specified project
-
getAllExecutors
public Collection<BuildExecutorDescriptor> getAllExecutors()
Description copied from interface:BuildExecutorsManager
Retrieves all build executors available in the system.- Specified by:
getAllExecutors
in interfaceBuildExecutorsManager
- Returns:
- a collection of all available
BuildExecutorDescriptor
instances.
-
getOwnAvailableExecutors
@NotNull public List<BuildExecutorDescriptor> getOwnAvailableExecutors(@NotNull SProject project, boolean includeSubprojects)
Description copied from interface:BuildExecutorsManager
Retrieves a list of available build executors for the specified project.- Specified by:
getOwnAvailableExecutors
in interfaceBuildExecutorsManager
- Parameters:
project
- current projectsincludeSubprojects
- if true, include executors from subprojects- Returns:
- a list of build executor descriptors available for the specified project
-
addExecutor
@NotNull public BuildExecutorDescriptor addExecutor(@NotNull SProject project, @NotNull Map<String,String> parameters, @NotNull String executorType)
Description copied from interface:BuildExecutorsManager
Adds a new executor to the specified project.- Specified by:
addExecutor
in interfaceBuildExecutorsManager
- Parameters:
project
- the project to add the executor toparameters
- the parameters for the executorexecutorType
- the type of the executor to add- Returns:
- the descriptor of the added executor
-
addExecutor
@NotNull public BuildExecutorDescriptor addExecutor(@NotNull SProject project, @NotNull Map<String,String> parameters, @NotNull BuildExecutorType executorType)
Description copied from interface:BuildExecutorsManager
Adds a new executor to the specified project.- Specified by:
addExecutor
in interfaceBuildExecutorsManager
- Parameters:
project
- the project to add the executor toparameters
- the parameters for the executorexecutorType
- the type of the executor to add- Returns:
- the descriptor of the added executor
-
updateExecutor
public boolean updateExecutor(@NotNull SProject project, @NotNull String executorId, @NotNull String executorType, @NotNull Map<String,String> parameters)
Description copied from interface:BuildExecutorsManager
Updates the executor with the specified executorId and providerType in the given project with the provided parameters.- Specified by:
updateExecutor
in interfaceBuildExecutorsManager
- Parameters:
project
- the project containing the executorexecutorId
- the id of the executor to updateexecutorType
- the type of the executorparameters
- the new parameters for the executor- Returns:
- true if the executor was successfully updated, false otherwise
-
removeExecutor
public void removeExecutor(@NotNull SProject project, @NotNull String executorId)
Description copied from interface:BuildExecutorsManager
Removes a build executor with the specified executorId from the given project.- Specified by:
removeExecutor
in interfaceBuildExecutorsManager
- Parameters:
project
- the project from which to remove the executorexecutorId
- the id of the executor to remove
-
getExecutorTypes
@NotNull public Collection<BuildExecutorType> getExecutorTypes()
- Specified by:
getExecutorTypes
in interfaceBuildExecutorsManager
- Returns:
- all available BuildExecutorType
-
findExecutorType
@Nullable public BuildExecutorType findExecutorType(@NotNull String type)
Description copied from interface:BuildExecutorsManager
Finds the BuildExecutorType with the specified type.- Specified by:
findExecutorType
in interfaceBuildExecutorsManager
- Parameters:
type
- the type of the BuildExecutorType to find- Returns:
- the BuildExecutorType with the specified type, or null if not found
-
setExecutorEnabled
public void setExecutorEnabled(@NotNull SProject project, @NotNull String executorId, boolean enabled) throws RuntimeException
- Specified by:
setExecutorEnabled
in interfaceBuildExecutorsManager
- Throws:
RuntimeException
-
isExecutorEnabled
public boolean isExecutorEnabled(@NotNull SProject project, @NotNull String executorId) throws RuntimeException
- Specified by:
isExecutorEnabled
in interfaceBuildExecutorsManager
- Throws:
RuntimeException
-
-