Class ArtifactsStorageSettingsManagerImpl
- java.lang.Object
-
- jetbrains.buildServer.serverSide.storage.ArtifactsStorageSettingsManagerImpl
-
- All Implemented Interfaces:
ArtifactsStorageSettingsManager
public class ArtifactsStorageSettingsManagerImpl extends Object implements ArtifactsStorageSettingsManager
Created by Nikita.Skvortsov date: 01.03.2017.
-
-
Constructor Summary
Constructors Constructor Description ArtifactsStorageSettingsManagerImpl()
-
Method Summary
All Methods Instance Methods Concrete 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 settingsId)
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 public SProjectFeatureDescriptor addSettings(@NotNull SProject project, @Nullable String artifactStorageId, @NotNull ArtifactStorageType artifactsStorageType, boolean isActive, @NotNull Map<String,String> addParams)
Description copied from interface:ArtifactsStorageSettingsManager
Add new storage settings to a project.- Specified by:
addSettings
in interfaceArtifactsStorageSettingsManager
- Parameters:
project
- target projectartifactsStorageType
- 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
public void activateSettings(@NotNull SProject project, @NotNull String settingsId)
Description copied from interface:ArtifactsStorageSettingsManager
Make particular settings active for a project. Only one settings can be active in a project at any time.- Specified by:
activateSettings
in interfaceArtifactsStorageSettingsManager
- Parameters:
project
- target projectsettingsId
- id (SProjectFeatureDescriptor.getId()
) of settings to be activated
-
removeSettings
@NotNull public Set<SProject> removeSettings(@NotNull SProject project, @NotNull String settingsId)
Description copied from interface:ArtifactsStorageSettingsManager
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.- Specified by:
removeSettings
in interfaceArtifactsStorageSettingsManager
- Parameters:
project
- project, where settings belong tosettingsId
- id (SProjectFeatureDescriptor.getId()
) of settings to delete- Returns:
- set of affected projects
-
updateSettings
public void updateSettings(@NotNull SProject project, @NotNull String settingsId, @NotNull Map<String,String> newParams)
Description copied from interface:ArtifactsStorageSettingsManager
Update settings- Specified by:
updateSettings
in interfaceArtifactsStorageSettingsManager
- Parameters:
project
- project, where settings belong tosettingsId
- id (SProjectFeatureDescriptor.getId()
) of settings to deletenewParams
- new settings. Will replace all existing settings
-
isActive
public boolean isActive(@NotNull SProject project, @NotNull String id)
Description copied from interface:ArtifactsStorageSettingsManager
Check if settings are explicitly active in a project- Specified by:
isActive
in interfaceArtifactsStorageSettingsManager
- Parameters:
project
- target projectid
- id (SProjectFeatureDescriptor.getId()
) of settings- Returns:
true
if settings are explicitly activated,false
otherwise
-
deactivateSettings
public boolean deactivateSettings(@NotNull SProject project, @NotNull String settingsId)
Description copied from interface:ArtifactsStorageSettingsManager
De-activate settings with given id in given project.- Specified by:
deactivateSettings
in interfaceArtifactsStorageSettingsManager
- Parameters:
project
- target project.- Returns:
- true if settings were deactivated
-
findEffectiveSettings
@Nullable public String findEffectiveSettings(@NotNull SProject project)
Description copied from interface:ArtifactsStorageSettingsManager
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)- Specified by:
findEffectiveSettings
in interfaceArtifactsStorageSettingsManager
- 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 public Pair<SProject,SProjectFeatureDescriptor> findSettingsWithSource(@NotNull SProject project, @NotNull String settingsId)
Description copied from interface:ArtifactsStorageSettingsManager
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- Specified by:
findSettingsWithSource
in interfaceArtifactsStorageSettingsManager
- Parameters:
project
- project to start withsettingsId
- id (SProjectFeatureDescriptor.getId()
) of settings- Returns:
- feature pair of
SProject
andSProjectFeatureDescriptor
that contains settings.null
otherwise
-
-