Class CloudProfilePersistorFacade
- java.lang.Object
-
- jetbrains.buildServer.clouds.server.impl.profile.CloudProfilePersistorFacade
-
- All Implemented Interfaces:
CloudProfilePersistor
public class CloudProfilePersistorFacade extends Object implements CloudProfilePersistor
- Author:
- Eugene Petrenko Created: 01.10.2009 19:49:18
-
-
Constructor Summary
Constructors Constructor Description CloudProfilePersistorFacade(ProjectManager projectManager, SecurityContext securityContext, ConfigActionFactory configActionFactory)
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description CloudImageParameters
createImage(String projectId, CloudImageData imageData)
Create image with given parameters in a roject with given idCloudProfile
createProfile(String projectId, CloudProfileData data)
Creates new profile and persists it Calling this method may triggerCloudEventListener#profilesUpdated(java.util.Collection, boolean)
call.Collection<CloudImageParameters>
getImages(String projectId)
Get images based on configured project features.Collection<CloudImageParameters>
getImages(SProject project)
Get images based on configured project features.ProjectCloudIntegrationStatus
getIntegrationStatus(String projectId)
returns project's cloud integration statusCollection<CloudProfile>
getProfiles(String projectId)
Get profiles based on configured project features.Collection<CloudProfile>
getProfiles(SProject project)
Get profiles based on configured project features.boolean
hasCloudRelatedConfiguration(String projectId)
Returns true if settings of the project with given id contain cloud related configurationboolean
isConfigurable(String projectId)
boolean
isIntegrationEnabled(String projectId)
boolean
removeImage(String projectId, String profileId, String imageId)
Remove image located in given project and profile and with given idboolean
removeImageWithInternalId(String projectId, String imageInternalId)
Remove image located in given project and with given internal idboolean
removeProfile(String projectId, String profileId)
Removes profile with specified idboolean
setProfileEnabled(String projectId, String profileId, boolean isEnabled)
Marks certain cloud profile as enabled or disabled.CloudImageParameters
updateImage(String projectId, CloudImageData newData)
Updates currently persisted image.CloudImageParameters
updateImageWithInternalId(String projectId, String imageInternalId, CloudImageData newData)
Updates currently persisted image.CloudProfile
updateProfile(String projectId, String profileId, CloudProfileData newData)
Updates currently persisted profile.void
updateStatus(String projectId, ProjectCloudIntegrationStatus status)
Marks cloud integration as enabled or disabled in this project.
-
-
-
Constructor Detail
-
CloudProfilePersistorFacade
public CloudProfilePersistorFacade(@NotNull ProjectManager projectManager, @NotNull SecurityContext securityContext, @NotNull ConfigActionFactory configActionFactory)
-
-
Method Detail
-
getProfiles
public Collection<CloudProfile> getProfiles(@NotNull String projectId)
Get profiles based on configured project features.- Specified by:
getProfiles
in interfaceCloudProfilePersistor
- Parameters:
project
-- Returns:
- profiles
-
getProfiles
@NotNull public Collection<CloudProfile> getProfiles(@NotNull SProject project)
Get profiles based on configured project features.- Specified by:
getProfiles
in interfaceCloudProfilePersistor
- Parameters:
project
-- Returns:
- profiles
-
getImages
@NotNull public Collection<CloudImageParameters> getImages(@NotNull String projectId)
Description copied from interface:CloudProfilePersistor
Get images based on configured project features. Both - configured in profiles and inherited from parent projects.- Specified by:
getImages
in interfaceCloudProfilePersistor
- Returns:
- all cloud images (own and inherited)
-
getImages
@NotNull public Collection<CloudImageParameters> getImages(@NotNull SProject project)
Description copied from interface:CloudProfilePersistor
Get images based on configured project features. Both - configured in profiles and inherited from parent projects.- Specified by:
getImages
in interfaceCloudProfilePersistor
- Returns:
- all cloud images (own and inherited)
-
createImage
@NotNull public CloudImageParameters createImage(@NotNull String projectId, @NotNull CloudImageData imageData)
Description copied from interface:CloudProfilePersistor
Create image with given parameters in a roject with given id- Specified by:
createImage
in interfaceCloudProfilePersistor
- Returns:
- Newly created image
-
updateImage
@NotNull public CloudImageParameters updateImage(@NotNull String projectId, @NotNull CloudImageData newData)
Description copied from interface:CloudProfilePersistor
Updates currently persisted image.- Specified by:
updateImage
in interfaceCloudProfilePersistor
-
updateImageWithInternalId
@NotNull public CloudImageParameters updateImageWithInternalId(@NotNull String projectId, @NotNull String imageInternalId, @NotNull CloudImageData newData)
Description copied from interface:CloudProfilePersistor
Updates currently persisted image.- Specified by:
updateImageWithInternalId
in interfaceCloudProfilePersistor
-
removeImage
public boolean removeImage(@NotNull String projectId, @NotNull String profileId, @NotNull String imageId)
Description copied from interface:CloudProfilePersistor
Remove image located in given project and profile and with given id- Specified by:
removeImage
in interfaceCloudProfilePersistor
- Returns:
- true if image was actually removed, False otherwise
-
removeImageWithInternalId
public boolean removeImageWithInternalId(@NotNull String projectId, @NotNull String imageInternalId)
Description copied from interface:CloudProfilePersistor
Remove image located in given project and with given internal id- Specified by:
removeImageWithInternalId
in interfaceCloudProfilePersistor
- Returns:
- true if image was actually removed, False otherwise
-
isIntegrationEnabled
public boolean isIntegrationEnabled(@NotNull String projectId)
- Specified by:
isIntegrationEnabled
in interfaceCloudProfilePersistor
- Returns:
- true if integration is enabled in a project considering project hierarchy
-
getIntegrationStatus
@NotNull public ProjectCloudIntegrationStatus getIntegrationStatus(@NotNull String projectId)
Description copied from interface:CloudProfilePersistor
returns project's cloud integration status- Specified by:
getIntegrationStatus
in interfaceCloudProfilePersistor
- Returns:
-
isConfigurable
public boolean isConfigurable(@NotNull String projectId)
- Specified by:
isConfigurable
in interfaceCloudProfilePersistor
- Parameters:
projectId
-- Returns:
- true if cloud configuration is available in a project considering project hierarchy
-
hasCloudRelatedConfiguration
public boolean hasCloudRelatedConfiguration(@NotNull String projectId)
Description copied from interface:CloudProfilePersistor
Returns true if settings of the project with given id contain cloud related configuration- Specified by:
hasCloudRelatedConfiguration
in interfaceCloudProfilePersistor
- Returns:
-
createProfile
@NotNull public CloudProfile createProfile(@NotNull String projectId, @NotNull CloudProfileData data)
Description copied from interface:CloudProfilePersistor
Creates new profile and persists it Calling this method may triggerCloudEventListener#profilesUpdated(java.util.Collection, boolean)
call.- Specified by:
createProfile
in interfaceCloudProfilePersistor
data
- profile info to save
-
removeProfile
public boolean removeProfile(@NotNull String projectId, @NotNull String profileId)
Description copied from interface:CloudProfilePersistor
Removes profile with specified id- Specified by:
removeProfile
in interfaceCloudProfilePersistor
profileId
- profileId to remove- Returns:
- True if profile was actually removed, False otherwise
-
updateProfile
@NotNull public CloudProfile updateProfile(@NotNull String projectId, @NotNull String profileId, @NotNull CloudProfileData newData)
Description copied from interface:CloudProfilePersistor
Updates currently persisted profile.- Specified by:
updateProfile
in interfaceCloudProfilePersistor
profileId
- profile id to updatenewData
- new values
-
updateStatus
public void updateStatus(@NotNull String projectId, ProjectCloudIntegrationStatus status)
Description copied from interface:CloudProfilePersistor
Marks cloud integration as enabled or disabled in this project.- Specified by:
updateStatus
in interfaceCloudProfilePersistor
status
- false to disable could integration
-
setProfileEnabled
public boolean setProfileEnabled(@NotNull String projectId, String profileId, boolean isEnabled)
Description copied from interface:CloudProfilePersistor
Marks certain cloud profile as enabled or disabled.- Specified by:
setProfileEnabled
in interfaceCloudProfilePersistor
profileId
- id of profile to updateisEnabled
- false to disable profile- Returns:
- is change applied successfully
-
-