Class CloudManagerBaseImpl
- java.lang.Object
-
- jetbrains.buildServer.clouds.server.impl.CloudManagerBaseImpl
-
- All Implemented Interfaces:
CloudManagerBase
,AfterBuildsCleanupExtension
,ServerExtension
,TeamCityExtension
public class CloudManagerBaseImpl extends Object implements CloudManagerBase, AfterBuildsCleanupExtension
- Author:
- Eugene Petrenko Created: 09.10.2009 14:09:13
-
-
Constructor Summary
Constructors Constructor Description CloudManagerBaseImpl(CloudRegistry registry, CloudProfilePersistor profilePersistor, CloudEventDispatcher cloudEventDispatcher, ProjectManagerEx projectManager, EventDispatcher<BuildServerListener> serverEvents, CloudStateManager stateManager, AgentTypeStorage agentTypeStorage, ExecutorServices executorServices, ServerResponsibility serverResponsibility, SecurityContextEx securityContext, MultiNodeTasks nodeTasks, EventDispatcher<NodeEffectiveResponsibilityListener> effectiveResponsibilityEventDispatcher)
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description void
afterCleanup(CleanupProcessState cleanupState)
Invoked upon finishing of the main cleanup process.CloudImageParameters
createImage(String projectId, CloudImageData imageData)
CloudProfile
createProfile(String projectId, CloudProfileData profileData)
void
deleteImage(String projectId, String profileId, String imageId)
Deletes a cloud image with the specified imageId from a cloud profilevoid
disposeClient(String projectId, String profileId)
Disposes resources related to a specific cloud profile.CloudType
findCloudType(String cloudName)
CloudImageParameters
findImageByInternalId(String projectId, String imageInternalId)
CloudProfile
findProfileById(String projectId, String profileId)
CloudProfile
findProfileByImageId(String imageId)
CloudProfile
findProfileGloballyById(String profileId)
CloudClientEx
getClient(String projectId, String profileId)
CloudClientEx
getClientIfExists(String projectId, String profileId)
CloudClientEx
getClientIfExistsByProjectExtId(String projectExtId, String profileId)
Collection<? extends CloudType>
getCloudTypes()
Returns all available "Real" cloud types, excluding ReadOnlyClient (which is not a "real" cloud type, but rather used to show instances on the secondary nodes).ProjectCloudIntegrationStatus
getProjectIntegrationStatus(String projectId)
boolean
isConfigurable(String projectId)
Returns true if user can enable/disable configuration in the current project's treeboolean
isIntegrationEnabled(String projectId)
Collection<CloudProfile>
listAllProfiles()
Returns all profiles available on server across all projects.Collection<CloudProfile>
listAllProfilesFull()
Collection<CloudImageParameters>
listImagesByProject(String projectId)
Collection<CloudProfile>
listProfilesByProject(String projectId, boolean includeFromSubprojects)
boolean
removeProfile(String projectId, String profileId)
void
setAgentPoolManager(AgentPoolManager agentPoolManager)
void
setCloudStateHolder(CloudStateHolder cloudStateHolder)
void
setProfileEnabled(String projectId, String profileId, boolean enabled)
CloudProfile
updateProfile(String projectId, String profileId, CloudProfileData cloudProfileData)
void
updateStatus(String projectId, ProjectCloudIntegrationStatus newStatus)
-
-
-
Constructor Detail
-
CloudManagerBaseImpl
public CloudManagerBaseImpl(@NotNull CloudRegistry registry, @NotNull CloudProfilePersistor profilePersistor, @NotNull CloudEventDispatcher cloudEventDispatcher, @NotNull ProjectManagerEx projectManager, @NotNull EventDispatcher<BuildServerListener> serverEvents, @NotNull CloudStateManager stateManager, @NotNull AgentTypeStorage agentTypeStorage, @NotNull ExecutorServices executorServices, @NotNull ServerResponsibility serverResponsibility, @NotNull SecurityContextEx securityContext, @NotNull MultiNodeTasks nodeTasks, @NotNull EventDispatcher<NodeEffectiveResponsibilityListener> effectiveResponsibilityEventDispatcher)
-
-
Method Detail
-
setAgentPoolManager
public void setAgentPoolManager(@NotNull AgentPoolManager agentPoolManager)
-
setCloudStateHolder
public void setCloudStateHolder(@NotNull CloudStateHolder cloudStateHolder)
-
isIntegrationEnabled
public boolean isIntegrationEnabled(@NotNull String projectId)
- Specified by:
isIntegrationEnabled
in interfaceCloudManagerBase
- Returns:
- true if cloud integration is enabled in the project with given id
-
isConfigurable
public boolean isConfigurable(@NotNull String projectId)
Returns true if user can enable/disable configuration in the current project's tree- Specified by:
isConfigurable
in interfaceCloudManagerBase
- Parameters:
projectId
- project internal id- Returns:
- see above
-
updateStatus
public void updateStatus(@NotNull String projectId, @NotNull ProjectCloudIntegrationStatus newStatus)
- Specified by:
updateStatus
in interfaceCloudManagerBase
-
getProjectIntegrationStatus
@Nullable public ProjectCloudIntegrationStatus getProjectIntegrationStatus(String projectId)
- Specified by:
getProjectIntegrationStatus
in interfaceCloudManagerBase
- Parameters:
projectId
- - project internal id- Returns:
- returns cloud integration status information in this project; null, if project doesn't have any information (inherits from parent project)
-
createProfile
@NotNull public CloudProfile createProfile(@NotNull String projectId, @NotNull CloudProfileData profileData)
- Specified by:
createProfile
in interfaceCloudManagerBase
-
removeProfile
public boolean removeProfile(@NotNull String projectId, @NotNull String profileId)
- Specified by:
removeProfile
in interfaceCloudManagerBase
-
setProfileEnabled
public void setProfileEnabled(@NotNull String projectId, @NotNull String profileId, boolean enabled)
- Specified by:
setProfileEnabled
in interfaceCloudManagerBase
-
listImagesByProject
@NotNull public Collection<CloudImageParameters> listImagesByProject(@NotNull String projectId)
- Specified by:
listImagesByProject
in interfaceCloudManagerBase
-
createImage
@NotNull public CloudImageParameters createImage(@NotNull String projectId, @NotNull CloudImageData imageData)
- Specified by:
createImage
in interfaceCloudManagerBase
-
deleteImage
public void deleteImage(@NotNull String projectId, @NotNull String profileId, @NotNull String imageId)
Description copied from interface:CloudManagerBase
Deletes a cloud image with the specified imageId from a cloud profile- Specified by:
deleteImage
in interfaceCloudManagerBase
- Parameters:
projectId
- The ID of the project that the image belongs to. Cannot be null.profileId
- The ID of the profile that the image belongs to. Cannot be null.imageId
- The ID of the image to be deleted. Cannot be null.
-
findImageByInternalId
@Nullable public CloudImageParameters findImageByInternalId(@NotNull String projectId, @NotNull String imageInternalId)
- Specified by:
findImageByInternalId
in interfaceCloudManagerBase
-
findProfileByImageId
@Nullable public CloudProfile findProfileByImageId(@NotNull String imageId)
- Specified by:
findProfileByImageId
in interfaceCloudManagerBase
-
updateProfile
@NotNull public CloudProfile updateProfile(@NotNull String projectId, @NotNull String profileId, @NotNull CloudProfileData cloudProfileData)
- Specified by:
updateProfile
in interfaceCloudManagerBase
-
listProfilesByProject
@NotNull public Collection<CloudProfile> listProfilesByProject(@NotNull String projectId, boolean includeFromSubprojects)
- Specified by:
listProfilesByProject
in interfaceCloudManagerBase
-
listAllProfilesFull
public Collection<CloudProfile> listAllProfilesFull()
- Returns:
- all cloud profiles, including duplicates.
-
listAllProfiles
@NotNull public Collection<CloudProfile> listAllProfiles()
Description copied from interface:CloudManagerBase
Returns all profiles available on server across all projects. CloudProfile#profileId is guaranteed to be unique in this list- Specified by:
listAllProfiles
in interfaceCloudManagerBase
- Returns:
-
getCloudTypes
@NotNull public Collection<? extends CloudType> getCloudTypes()
Description copied from interface:CloudManagerBase
Returns all available "Real" cloud types, excluding ReadOnlyClient (which is not a "real" cloud type, but rather used to show instances on the secondary nodes).- Specified by:
getCloudTypes
in interfaceCloudManagerBase
- Returns:
- list of types. No order specified
-
findCloudType
public CloudType findCloudType(@Nullable String cloudName)
- Specified by:
findCloudType
in interfaceCloudManagerBase
-
findProfileById
@Nullable public CloudProfile findProfileById(String projectId, @NotNull String profileId)
- Specified by:
findProfileById
in interfaceCloudManagerBase
-
findProfileGloballyById
@Nullable public CloudProfile findProfileGloballyById(@NotNull String profileId)
- Specified by:
findProfileGloballyById
in interfaceCloudManagerBase
-
getClientIfExists
@Nullable public CloudClientEx getClientIfExists(String projectId, @NotNull String profileId)
- Specified by:
getClientIfExists
in interfaceCloudManagerBase
-
getClientIfExistsByProjectExtId
public CloudClientEx getClientIfExistsByProjectExtId(String projectExtId, @NotNull String profileId)
- Specified by:
getClientIfExistsByProjectExtId
in interfaceCloudManagerBase
-
getClient
@NotNull public CloudClientEx getClient(String projectId, @NotNull String profileId)
- Specified by:
getClient
in interfaceCloudManagerBase
-
disposeClient
public void disposeClient(@NotNull String projectId, @NotNull String profileId)
Description copied from interface:CloudManagerBase
Disposes resources related to a specific cloud profile.- Specified by:
disposeClient
in interfaceCloudManagerBase
- Parameters:
projectId
- the ID of the projectprofileId
- the ID of the cloud profile
-
afterCleanup
public void afterCleanup(@NotNull CleanupProcessState cleanupState) throws Exception
Description copied from interface:AfterBuildsCleanupExtension
Invoked upon finishing of the main cleanup process. At this point all data for specific builds is deleted.
Note: This extension might not be called for every cleanup run as cleanup process can be interrupted earlier. Extension must check cleanup process state and if it is interrupted, complete its operations and return as quick as possible.- Specified by:
afterCleanup
in interfaceAfterBuildsCleanupExtension
- Parameters:
cleanupState
- cleanup process state- Throws:
CleanupInterruptedException
- if the cleanup process was interruptedException
- on any other error
-
-