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 voidactivateSettings(SProject project, String settingsId)Make particular settings active for a project.SProjectFeatureDescriptoraddSettings(SProject project, String artifactStorageId, ArtifactStorageType artifactsStorageType, boolean isActive, Map<String,String> addParams)Add new storage settings to a project.booleandeactivateSettings(SProject project, String settingsId)De-activate settings with given id in given project.StringfindEffectiveSettings(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.booleanisActive(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.voidupdateSettings(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:ArtifactsStorageSettingsManagerAdd new storage settings to a project.- Specified by:
addSettingsin 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_TYPEwith settings.
-
activateSettings
public void activateSettings(@NotNull SProject project, @NotNull String settingsId)Description copied from interface:ArtifactsStorageSettingsManagerMake particular settings active for a project. Only one settings can be active in a project at any time.- Specified by:
activateSettingsin 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:ArtifactsStorageSettingsManagerRemoves 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:
removeSettingsin 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:ArtifactsStorageSettingsManagerUpdate settings- Specified by:
updateSettingsin 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:ArtifactsStorageSettingsManagerCheck if settings are explicitly active in a project- Specified by:
isActivein interfaceArtifactsStorageSettingsManager- Parameters:
project- target projectid- id (SProjectFeatureDescriptor.getId()) of settings- Returns:
trueif settings are explicitly activated,falseotherwise
-
deactivateSettings
public boolean deactivateSettings(@NotNull SProject project, @NotNull String settingsId)Description copied from interface:ArtifactsStorageSettingsManagerDe-activate settings with given id in given project.- Specified by:
deactivateSettingsin interfaceArtifactsStorageSettingsManager- Parameters:
project- target project.- Returns:
- true if settings were deactivated
-
findEffectiveSettings
@Nullable public String findEffectiveSettings(@NotNull SProject project)
Description copied from interface:ArtifactsStorageSettingsManagerFind 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:
findEffectiveSettingsin interfaceArtifactsStorageSettingsManager- Parameters:
project- project to find- Returns:
- feature id or
nullif 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:ArtifactsStorageSettingsManagerFind 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:
findSettingsWithSourcein interfaceArtifactsStorageSettingsManager- Parameters:
project- project to start withsettingsId- id (SProjectFeatureDescriptor.getId()) of settings- Returns:
- feature pair of
SProjectandSProjectFeatureDescriptorthat contains settings.nullotherwise
-
-