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 voidafterCleanup(CleanupProcessState cleanupState)Invoked upon finishing of the main cleanup process.CloudImageParameterscreateImage(String projectId, CloudImageData imageData)CloudProfilecreateProfile(String projectId, CloudProfileData profileData)voiddeleteImage(String projectId, String profileId, String imageId)Deletes a cloud image with the specified imageId from a cloud profilevoiddisposeClient(String projectId, String profileId)Disposes resources related to a specific cloud profile.CloudTypefindCloudType(String cloudName)CloudImageParametersfindImageByInternalId(String projectId, String imageInternalId)CloudProfilefindProfileById(String projectId, String profileId)CloudProfilefindProfileByImageId(String imageId)CloudProfilefindProfileGloballyById(String profileId)CloudClientExgetClient(String projectId, String profileId)CloudClientExgetClientIfExists(String projectId, String profileId)CloudClientExgetClientIfExistsByProjectExtId(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).ProjectCloudIntegrationStatusgetProjectIntegrationStatus(String projectId)booleanisConfigurable(String projectId)Returns true if user can enable/disable configuration in the current project's treebooleanisIntegrationEnabled(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)booleanremoveProfile(String projectId, String profileId)voidsetAgentPoolManager(AgentPoolManager agentPoolManager)voidsetCloudStateHolder(CloudStateHolder cloudStateHolder)voidsetProfileEnabled(String projectId, String profileId, boolean enabled)CloudProfileupdateProfile(String projectId, String profileId, CloudProfileData cloudProfileData)voidupdateStatus(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:
isIntegrationEnabledin 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:
isConfigurablein interfaceCloudManagerBase- Parameters:
projectId- project internal id- Returns:
- see above
-
updateStatus
public void updateStatus(@NotNull String projectId, @NotNull ProjectCloudIntegrationStatus newStatus)- Specified by:
updateStatusin interfaceCloudManagerBase
-
getProjectIntegrationStatus
@Nullable public ProjectCloudIntegrationStatus getProjectIntegrationStatus(String projectId)
- Specified by:
getProjectIntegrationStatusin 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:
createProfilein interfaceCloudManagerBase
-
removeProfile
public boolean removeProfile(@NotNull String projectId, @NotNull String profileId)- Specified by:
removeProfilein interfaceCloudManagerBase
-
setProfileEnabled
public void setProfileEnabled(@NotNull String projectId, @NotNull String profileId, boolean enabled)- Specified by:
setProfileEnabledin interfaceCloudManagerBase
-
listImagesByProject
@NotNull public Collection<CloudImageParameters> listImagesByProject(@NotNull String projectId)
- Specified by:
listImagesByProjectin interfaceCloudManagerBase
-
createImage
@NotNull public CloudImageParameters createImage(@NotNull String projectId, @NotNull CloudImageData imageData)
- Specified by:
createImagein interfaceCloudManagerBase
-
deleteImage
public void deleteImage(@NotNull String projectId, @NotNull String profileId, @NotNull String imageId)Description copied from interface:CloudManagerBaseDeletes a cloud image with the specified imageId from a cloud profile- Specified by:
deleteImagein 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:
findImageByInternalIdin interfaceCloudManagerBase
-
findProfileByImageId
@Nullable public CloudProfile findProfileByImageId(@NotNull String imageId)
- Specified by:
findProfileByImageIdin interfaceCloudManagerBase
-
updateProfile
@NotNull public CloudProfile updateProfile(@NotNull String projectId, @NotNull String profileId, @NotNull CloudProfileData cloudProfileData)
- Specified by:
updateProfilein interfaceCloudManagerBase
-
listProfilesByProject
@NotNull public Collection<CloudProfile> listProfilesByProject(@NotNull String projectId, boolean includeFromSubprojects)
- Specified by:
listProfilesByProjectin interfaceCloudManagerBase
-
listAllProfilesFull
public Collection<CloudProfile> listAllProfilesFull()
- Returns:
- all cloud profiles, including duplicates.
-
listAllProfiles
@NotNull public Collection<CloudProfile> listAllProfiles()
Description copied from interface:CloudManagerBaseReturns all profiles available on server across all projects. CloudProfile#profileId is guaranteed to be unique in this list- Specified by:
listAllProfilesin interfaceCloudManagerBase- Returns:
-
getCloudTypes
@NotNull public Collection<? extends CloudType> getCloudTypes()
Description copied from interface:CloudManagerBaseReturns 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:
getCloudTypesin interfaceCloudManagerBase- Returns:
- list of types. No order specified
-
findCloudType
public CloudType findCloudType(@Nullable String cloudName)
- Specified by:
findCloudTypein interfaceCloudManagerBase
-
findProfileById
@Nullable public CloudProfile findProfileById(String projectId, @NotNull String profileId)
- Specified by:
findProfileByIdin interfaceCloudManagerBase
-
findProfileGloballyById
@Nullable public CloudProfile findProfileGloballyById(@NotNull String profileId)
- Specified by:
findProfileGloballyByIdin interfaceCloudManagerBase
-
getClientIfExists
@Nullable public CloudClientEx getClientIfExists(String projectId, @NotNull String profileId)
- Specified by:
getClientIfExistsin interfaceCloudManagerBase
-
getClientIfExistsByProjectExtId
public CloudClientEx getClientIfExistsByProjectExtId(String projectExtId, @NotNull String profileId)
- Specified by:
getClientIfExistsByProjectExtIdin interfaceCloudManagerBase
-
getClient
@NotNull public CloudClientEx getClient(String projectId, @NotNull String profileId)
- Specified by:
getClientin interfaceCloudManagerBase
-
disposeClient
public void disposeClient(@NotNull String projectId, @NotNull String profileId)Description copied from interface:CloudManagerBaseDisposes resources related to a specific cloud profile.- Specified by:
disposeClientin interfaceCloudManagerBase- Parameters:
projectId- the ID of the projectprofileId- the ID of the cloud profile
-
afterCleanup
public void afterCleanup(@NotNull CleanupProcessState cleanupState) throws ExceptionDescription copied from interface:AfterBuildsCleanupExtensionInvoked 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:
afterCleanupin interfaceAfterBuildsCleanupExtension- Parameters:
cleanupState- cleanup process state- Throws:
CleanupInterruptedException- if the cleanup process was interruptedException- on any other error
-
-