Interface ArtifactsStorageSettingsManager
-
- All Known Implementing Classes:
ArtifactsStorageSettingsManagerImpl
public interface ArtifactsStorageSettingsManager
Created by Nikita.Skvortsov date: 01.03.2017. Manage settings of artifacts storage for a project.- Since:
- 2017.1
-
-
Method Summary
All Methods Instance Methods Abstract Methods Modifier and Type Method Description void
activateSettings(SProject project, String settingsId)
Make particular settings active for a project.SProjectFeatureDescriptor
addSettings(SProject project, String artifactStorageId, ArtifactStorageType artifactsStorageType, boolean isActive, Map<String,String> addParams)
Add new storage settings to a project.boolean
deactivateSettings(SProject project, String id)
De-activate settings with given id in given project.String
findEffectiveSettings(SProject project)
Find id (SProjectFeatureDescriptor.getId()
) of settings, that will be used by builds in a project.Pair<SProject,SProjectFeatureDescriptor>
findSettingsWithSource(SProject project, String settingsId)
Find project that contains settings with given id.boolean
isActive(SProject project, String id)
Check if settings are explicitly active in a projectSet<SProject>
removeSettings(SProject project, String settingsId)
Removes settings having the specified id, and deactivates them in current project and all its sub projects.void
updateSettings(SProject project, String settingsId, Map<String,String> newParams)
Update settings
-
-
-
Method Detail
-
addSettings
@NotNull SProjectFeatureDescriptor addSettings(@NotNull SProject project, @Nullable String artifactStorageId, @NotNull ArtifactStorageType artifactsStorageType, boolean isActive, @NotNull Map<String,String> addParams)
Add new storage settings to a project.- Parameters:
project
- target projectstorageSettingsId
- ID to be used for this storage. If no ID is provided, then it will be generated automaticallyartifactsStorageType
- storage to be usedisActive
- make storage active for the projectaddParams
- parameters to use as settings- Returns:
- project feature of type
ArtifactStorageSettings.STORAGE_FEATURE_TYPE
with settings.
-
activateSettings
void activateSettings(@NotNull SProject project, @NotNull String settingsId)
Make particular settings active for a project. Only one settings can be active in a project at any time.- Parameters:
project
- target projectsettingsId
- id (SProjectFeatureDescriptor.getId()
) of settings to be activated
-
removeSettings
@NotNull Set<SProject> removeSettings(@NotNull SProject project, @NotNull String settingsId)
Removes settings having the specified id, and deactivates them in current project and all its sub projects. Returns set of projects whose settings were affected.- Parameters:
project
- project, where settings belong tosettingsId
- id (SProjectFeatureDescriptor.getId()
) of settings to delete- Returns:
- set of affected projects
-
updateSettings
void updateSettings(@NotNull SProject project, @NotNull String settingsId, @NotNull Map<String,String> newParams)
Update settings- Parameters:
project
- project, where settings belong tosettingsId
- id (SProjectFeatureDescriptor.getId()
) of settings to deletenewParams
- new settings. Will replace all existing settings
-
isActive
boolean isActive(@NotNull SProject project, @NotNull String id)
Check if settings are explicitly active in a project- Parameters:
project
- target projectid
- id (SProjectFeatureDescriptor.getId()
) of settings- Returns:
true
if settings are explicitly activated,false
otherwise
-
deactivateSettings
boolean deactivateSettings(@NotNull SProject project, @NotNull String id)
De-activate settings with given id in given project.- Parameters:
project
- target project.- Returns:
- true if settings were deactivated
-
findEffectiveSettings
@Nullable String findEffectiveSettings(@NotNull SProject project)
Find id (SProjectFeatureDescriptor.getId()
) of settings, that will be used by builds in a project. Effective settings can are explicitly active in the project or are inherited from some parent project (nearest explicitly active)- Parameters:
project
- project to find- Returns:
- feature id or
null
if no storage settings are used (artifacts will be published to TeamCity server)
-
findSettingsWithSource
@Nullable Pair<SProject,SProjectFeatureDescriptor> findSettingsWithSource(@NotNull SProject project, @NotNull String settingsId)
Find project that contains settings with given id. Search the hierarchy of projects upwards, starting with given project, looking for storage settings with given id- Parameters:
project
- project to start withsettingsId
- id (SProjectFeatureDescriptor.getId()
) of settings- Returns:
- feature pair of
SProject
andSProjectFeatureDescriptor
that contains settings.null
otherwise
-
-