Class SecuredProject
- java.lang.Object
-
- jetbrains.buildServer.serverSide.impl.projects.ProjectImpl
-
- jetbrains.buildServer.serverSide.impl.auth.SecuredProject
-
- All Implemented Interfaces:
Comparable<BuildProject>
,BuildProject
,Loggable
,CleanupSettings
,CleanupSettingsInit
,ParameterSupport
,ProjectEx
,SecureDataStorage
,SecureTokensProducer
,InheritableUserParametersHolder
,InheritableUserParametersHolderEx
,InternalParameters
,ParametersSupport
,ReadOnlyUserParameters
,SPersistentEntity
,SProject
,UserParametersHolder
public class SecuredProject extends ProjectImpl
-
-
Nested Class Summary
-
Nested classes/interfaces inherited from class jetbrains.buildServer.serverSide.impl.projects.ProjectImpl
ProjectImpl.Cached<T>
-
-
Field Summary
-
Fields inherited from class jetbrains.buildServer.serverSide.impl.projects.ProjectImpl
AUTOMATIC_ARCHIVE_COMMENT, AUTOMATIC_DEARCHIVE_COMMENT, AUTOMATIC_PAUSE_COMMENT, AUTOMATIC_UNPAUSE_COMMENT, PROJECT_CREDENTIALS_STORAGE_PROP_NAME, TEAMCITY_SETTINGS_READ_ONLY_PARAM, TEAMCITY_SETTINGS_RUN_BUTTON_CAPTION_PARAM, TEAMCITY_VIRTUAL_PROJECT_PARAM, VERSIONED_SETTINGS_STORAGE_KEY
-
Fields inherited from interface jetbrains.buildServer.BuildProject
ROOT_PROJECT_ID
-
Fields inherited from interface jetbrains.buildServer.serverSide.CleanupSettings
CLEANUP_PREVENT_DEPENDENCIES_ARTIFACTS_FROM_CLEANUP, DISABLE_CLEANUP_POLICIES
-
-
Constructor Summary
Constructors Constructor Description SecuredProject(EntityId<String> id, String parentInternalId, String name, ProjectDataModel model, ProjectContext projectContext, boolean emptyUuid)
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description void
addCleanupPolicy(HistoryRetentionPolicy policy)
Sets cleanup policy for this build configurationSProjectFeatureDescriptor
addFeature(String id, String type, Map<String,String> params)
Adds new project feature with provided ID if auto-generated ID is not desirableSProjectFeatureDescriptor
addFeature(String type, Map<String,String> params)
Adds new project feature.void
addFeature(SProjectFeatureDescriptor feature)
Adds project feature.void
addParameter(Parameter param)
Adds parameter.SBuildType
copyBuildType(SBuildType originalBuildType, String extId, String name, CopyOptions copyOptions)
Creates a copy of the given build configuration.BuildTypeTemplate
copyBuildTypeTemplate(BuildTypeTemplate original, String extId, String name)
Creates new template by copying settings from the original one.SVcsRootEx
copyVcsRoot(SVcsRoot originalRoot, String externalId)
Creates a copy of original VCS root in this project.BuildTypeEx
createBuildType(String name)
Creates new build configuration with given nameBuildTypeEx
createBuildType(String extId, String name)
Creates new build configuration with given external identifier and name.BuildTypeEx
createBuildType(String name, String runnerType, int maxBuilds, BuildTypeDescriptor.CheckoutType checkoutType)
Creates a new build configurationBuildTypeEx
createBuildType(String extId, String name, Consumer<BuildTypeEx> init)
SBuildType
createBuildType(SBuildType originalBuildType, String newConfigurationName, boolean copyVcsRoots, boolean changeScopeOfLocalVcsRoots)
SBuildType
createBuildType(SBuildType originalBuildType, String name, CopyOptions copyOptions)
Creates new build configuration on the base of the specified original build configuration.BuildTypeEx
createBuildTypeFromTemplate(BuildTypeTemplate template, String extId, String name)
Creates build configuration on the base of specified template.BuildTypeEx
createBuildTypeFromTemplate(BuildTypeTemplate template, String extId, String name, Consumer<BuildTypeEx> init)
SBuildType
createBuildTypeFromTemplate(BuildTypeTemplate template, String name, CopyOptions copyOptions)
Creates build configuration on the base of specified template.BuildTypeTemplateEx
createBuildTypeTemplate(String name)
Creates new build configuration template.BuildTypeTemplateEx
createBuildTypeTemplate(String extId, String name)
Creates new build configuration template with given external identifier an name.BuildTypeTemplate
createBuildTypeTemplate(BuildTypeTemplate original, String name, CopyOptions copyOptions)
Creates new template by copying settings from the original one.BuildTypeTemplate
createBuildTypeTemplate(SBuildType originalBuildType, String name, CopyOptions copyOptions)
Extracts a template from the specified build type.ProjectEx
createProjectNoAudit(String externalId, String projectName)
SVcsRootEx
createVcsRoot(String vcsName, String externalId, String name)
Creates new VCS root in this projectSVcsRootEx
createVcsRoot(String vcsName, String name, Map<String,String> params)
Creates new VCS root in this projectBuildTypeTemplate
extractBuildTypeTemplate(SBuildType originalBuildType, String extId, String name)
Extracts a template from the specified build type.SBuildType
findBuildTypeByName(String name)
Searches for a build configuration with specified name among own build configurations of this project (not in subprojects).List<BuildTypeTemplate>
getAvailableTemplates()
List<SBuildType>
getBuildTypes()
Returns all build configurations registered in this project and all its subprojects (not only direct subprojects, but all).List<BuildTypeTemplate>
getBuildTypeTemplates()
Returns all build configuration templates registered in this project and all its subprojects (not only direct).String
getOrCreateToken(String secret, String contextDescription)
For a specified secret (password, API key, etc) creates a token which can be used in project settings instead.List<SProject>
getOwnProjects()
Returns only own sub projects of this project.List<SProject>
getProjects()
Returns all sub projects of this project transitively.List<VcsRootInstance>
getVcsRootInstances()
List<SVcsRoot>
getVcsRoots()
Returns all VCS roots associated with this project and all its subprojects transitively.void
moveToProject(ConfigAction cause, SProject target)
Moves this project to the target project.void
moveToProject(SProject target)
Moves this project to the target project.void
removeBuildTypes()
Unregisters all build types and templates.void
removeCleanupPolicies()
Remove all own cleanup policies for the objectSProjectFeatureDescriptor
removeFeature(String featureId)
Removes project feature with specified id.void
removeParameter(String paramName)
Removes parameter.void
setArchived(boolean archived, User user)
Sets project's and sub project's archived flags, pauses build configurations.void
setCleanupOption(String option, Boolean value)
Sets value for a cleanup optionvoid
setDefaultTemplate(BuildTypeTemplate template)
void
setDescription(String description)
Sets this project descriptionvoid
setEditable(boolean editable)
Enables or disables editing of the project in web UI, see alsoSPersistentEntity.isReadOnly()
.void
setEnforcedSettings(ProjectEnforcedSettings enforcedSettings)
Attach enforced settings profile to this project.void
setExternalId(String newId)
Sets the external project id.void
setExternalId(ConfigAction cause, String newId)
Sets the external project id.void
setName(String name)
Renames projectvoid
setOwnBuildTypesOrder(List<String> internalIds)
void
setOwnProjectsOrder(List<String> internalIds)
boolean
updateFeature(String featureId, String newType, Map<String,String> newParams)
Updates type and parameters of project feature with specified id.-
Methods inherited from class jetbrains.buildServer.serverSide.impl.projects.ProjectImpl
addBuildTypeTemplate, addDefaultTemplateListener, attachedToModel, attachEnforcedSettings, belongsTo, buildTypeCreated, checkCyclicDependencies, checkCyclicDependency, clearDefaultTemplateIdCacheForSelfAndChildren, clearProjectPathCache, compareTo, containsBuildType, copyBuildType, copyTemplate, createBuildType, createConfigAction, createDummyVcsRoot, createProject, createProjectNoAudit, createVirtualProject, describe, dispose, equals, findBuildTypeByExternalId, findBuildTypeById, findBuildTypeIdentityByName, findBuildTypeTemplateByExternalId, findBuildTypeTemplateById, findBuildTypeTemplateByName, findFeatureById, findPluginSettings, findProjectByName, findVcsRootByName, getAgentPools, getArchivingTime, getArchivingUser, getArtifactDirectories, getArtifactsDirectory, getAvailableFeatures, getAvailableFeaturesOfType, getAvailableVcsRoots, getCleanupOptions, getCleanupPolicies, getCommitters, getConfigDirectory, getConfigId, getConfigurationFile, getConfigurationFile, getCredentialsStorage, getCredentialsStorageType, getCustomDataStorage, getDefaultTemplate, getDefaultTemplateId, getDescription, getEditableSettingsNote, getEffectiveGenerator, getEnforcedSettings, getExtendedFullName, getExtendedName, getExternalId, getFullName, getId, getInheritedCleanupOptions, getInheritedCleanupPolicies, getInheritedParametersCollection, getLastConfigModificationAction, getMulticaster, getName, getNextAvailableFeatureId, getOrganizationProject, getOwnAndParentsNonInheritedParameter, getOwnAndParentsNonInheritedParameters, getOwnBuildTypes, getOwnBuildTypesOrder, getOwnBuildTypeTemplates, getOwnCleanupOptions, getOwnCleanupPolicies, getOwnCleanupSettingsSupport, getOwnDefaultTemplate, getOwnDefaultTemplateExternalId, getOwnDefaultTemplateId, getOwnEnforcedSettings, getOwnFeatures, getOwnFeaturesOfType, getOwnNonInheritedParameter, getOwnParameter, getOwnParameters, getOwnParametersCollection, getOwnParametersWithoutInheritedSpec, getOwnProjectsOrder, getOwnSerializableParameters, getOwnVcsRoots, getParameter, getParameters, getParametersCollection, getParametersProvider, getParametersSupport, getParameterValue, getParent, getParentProject, getParentProjectExternalId, getParentProjectId, getPluginDataDirectory, getPluginSettingsFile, getPotentiallyResponsibleUsers, getProjectDataModel, getProjectId, getProjectPath, getReadOnlyReason, getSecureValue, getSettingsRootSpec, getStatus, getStatus, getTokenContext, getTokensWithoutSecret, getUsedVcsRoots, getValueResolver, getVersion, getVersionedSettingsVcsRoot, getVirtualBuildTypes, hasBuildTypes, hashCode, hasSettingsWithSecureValues, hasVersionedSettings, init, initArchivedStatus, isArchived, isDefaultBranchExcluded, isEmptyUuid, isExtIdChangeSupported, isInModel, isMoveEntitiesSupported, isMoveSupported, isProjectCreateSupported, isProjectDeleteSupported, isReadOnly, isRootProject, isVirtual, markPersisted, persist, persist, remove, removeBuildType, removeBuildTypeTemplate, removeDefaultTemplateListener, replaceInValues, resetCachedReadOnlyReason, resortBuildTypes, saveSettingsBranchSpec, scheduleFileDelete, scheduleFileSave, schedulePersisting, schedulePersisting, scheduleProjectConfigurationReload, scheduleRemove, sendExtIdChangedEvents, setExternalId, storeBuildType, toString, unregister, updateParentInternally, validateNewExtId
-
Methods inherited from class java.lang.Object
clone, finalize, getClass, notify, notifyAll, wait, wait, wait
-
Methods inherited from interface jetbrains.buildServer.serverSide.InternalParameters
getBooleanInternalParameter, getBooleanInternalParameterOrTrue, getInternalParameterValue
-
-
-
-
Constructor Detail
-
SecuredProject
public SecuredProject(@NotNull EntityId<String> id, @Nullable String parentInternalId, @NotNull String name, @NotNull ProjectDataModel model, @NotNull ProjectContext projectContext, boolean emptyUuid)
-
-
Method Detail
-
getOwnProjects
@NotNull public List<SProject> getOwnProjects()
Description copied from interface:SProject
Returns only own sub projects of this project.- Specified by:
getOwnProjects
in interfaceBuildProject
- Specified by:
getOwnProjects
in interfaceSProject
- Overrides:
getOwnProjects
in classProjectImpl
- Returns:
- list of projects sorted by name
-
getProjects
@NotNull public List<SProject> getProjects()
Description copied from interface:SProject
Returns all sub projects of this project transitively.- Specified by:
getProjects
in interfaceBuildProject
- Specified by:
getProjects
in interfaceSProject
- Overrides:
getProjects
in classProjectImpl
- Returns:
- list of projects sorted by name
-
createBuildType
@NotNull public BuildTypeEx createBuildType(@NotNull String name) throws DuplicateBuildTypeNameException, MaxNumberOfBuildTypesReachedException
Description copied from interface:SProject
Creates new build configuration with given name- Specified by:
createBuildType
in interfaceProjectEx
- Specified by:
createBuildType
in interfaceSProject
- Overrides:
createBuildType
in classProjectImpl
- Parameters:
name
- name of the build configuration- Returns:
- newly created build configuration
- Throws:
DuplicateBuildTypeNameException
- if build configuration with such name already exists in this projectMaxNumberOfBuildTypesReachedException
- if maximum number of build configurations is reached- See Also:
SProject.createBuildType(String, String)
-
createBuildType
@NotNull public BuildTypeEx createBuildType(@NotNull String name, @NotNull String runnerType, int maxBuilds, BuildTypeDescriptor.CheckoutType checkoutType)
Description copied from interface:SProject
Creates a new build configuration- Specified by:
createBuildType
in interfaceProjectEx
- Specified by:
createBuildType
in interfaceSProject
- Overrides:
createBuildType
in classProjectImpl
- Parameters:
name
- name of the build configurationrunnerType
- type of the runnermaxBuilds
- maximum number of buildscheckoutType
- type of the checkout- Returns:
- newly created build configuration
- See Also:
SProject.createBuildType(String, String)
-
createBuildTypeTemplate
@NotNull public BuildTypeTemplateEx createBuildTypeTemplate(@NotNull String name)
Description copied from interface:SProject
Creates new build configuration template.- Specified by:
createBuildTypeTemplate
in interfaceProjectEx
- Specified by:
createBuildTypeTemplate
in interfaceSProject
- Overrides:
createBuildTypeTemplate
in classProjectImpl
- Parameters:
name
- name of the template- Returns:
- newly created template
- See Also:
SProject.createBuildTypeTemplate(String, String)
-
createBuildType
@NotNull public SBuildType createBuildType(SBuildType originalBuildType, String newConfigurationName, boolean copyVcsRoots, boolean changeScopeOfLocalVcsRoots) throws MaxNumberOfBuildTypesReachedException
- Specified by:
createBuildType
in interfaceSProject
- Overrides:
createBuildType
in classProjectImpl
- Throws:
MaxNumberOfBuildTypesReachedException
-
createBuildTypeTemplate
@NotNull public BuildTypeTemplate createBuildTypeTemplate(@NotNull BuildTypeTemplate original, @NotNull String name, @NotNull CopyOptions copyOptions)
Description copied from interface:SProject
Creates new template by copying settings from the original one.- Specified by:
createBuildTypeTemplate
in interfaceSProject
- Overrides:
createBuildTypeTemplate
in classProjectImpl
- Parameters:
original
- original templatename
- new template namecopyOptions
- options to control copy operation- Returns:
- new template
- See Also:
SProject.copyBuildTypeTemplate(BuildTypeTemplate, String, String)
-
createBuildTypeTemplate
@NotNull public BuildTypeTemplateEx createBuildTypeTemplate(@NotNull String extId, @NotNull String name) throws DuplicateTemplateNameException, DuplicateExternalIdException
Description copied from interface:SProject
Creates new build configuration template with given external identifier an name.- Specified by:
createBuildTypeTemplate
in interfaceProjectEx
- Specified by:
createBuildTypeTemplate
in interfaceSProject
- Overrides:
createBuildTypeTemplate
in classProjectImpl
- Parameters:
extId
- external id (must be unique thru all projects, case insensitively).name
- name for the new template.- Returns:
- newly created template.
- Throws:
DuplicateTemplateNameException
- thrown if template with such name already exists.DuplicateExternalIdException
- if this external identifier belongs to another template.
-
copyBuildTypeTemplate
@NotNull public BuildTypeTemplate copyBuildTypeTemplate(@NotNull BuildTypeTemplate original, @NotNull String extId, @NotNull String name)
Description copied from interface:SProject
Creates new template by copying settings from the original one.- Specified by:
copyBuildTypeTemplate
in interfaceSProject
- Overrides:
copyBuildTypeTemplate
in classProjectImpl
- Parameters:
original
- original templateextId
- new external identifier.name
- new template name- Returns:
- new template
-
extractBuildTypeTemplate
@NotNull public BuildTypeTemplate extractBuildTypeTemplate(@NotNull SBuildType originalBuildType, @NotNull String extId, @NotNull String name) throws DuplicateExternalIdException
Description copied from interface:SProject
Extracts a template from the specified build type.- Specified by:
extractBuildTypeTemplate
in interfaceSProject
- Overrides:
extractBuildTypeTemplate
in classProjectImpl
- Parameters:
originalBuildType
- original template.extId
- new template external identifier.name
- new template name.- Returns:
- new template.
- Throws:
DuplicateExternalIdException
- when the given external identifier belongs to another template.
-
copyBuildType
@NotNull public SBuildType copyBuildType(@NotNull SBuildType originalBuildType, @NotNull String extId, @NotNull String name, @NotNull CopyOptions copyOptions) throws MaxNumberOfBuildTypesReachedException, DuplicateExternalIdException
Description copied from interface:SProject
Creates a copy of the given build configuration.- Specified by:
copyBuildType
in interfaceSProject
- Overrides:
copyBuildType
in classProjectImpl
- Parameters:
originalBuildType
- build configuration to copyname
- name to use for new configuration. If there exists configuration with same name in the target project then " (1)", " (2)", ... suffix will be added to the specified name.copyOptions
- additional options- Returns:
- build configuration copy
- Throws:
MaxNumberOfBuildTypesReachedException
- if maximum number of build configurations is reachedDuplicateExternalIdException
-
createBuildType
@NotNull public BuildTypeEx createBuildType(@NotNull String extId, @NotNull String name) throws DuplicateBuildTypeNameException, MaxNumberOfBuildTypesReachedException
Description copied from interface:ProjectEx
Creates new build configuration with given external identifier and name.- Specified by:
createBuildType
in interfaceProjectEx
- Specified by:
createBuildType
in interfaceSProject
- Overrides:
createBuildType
in classProjectImpl
- Parameters:
extId
- external identifier for the new build configuration (must be unique in all build configuration scope, case insensitively).name
- name of the build configuration (must be unique in the project scope).- Returns:
- newly created build configuration.
- Throws:
DuplicateBuildTypeNameException
- if build configuration with such name already exists in this project.MaxNumberOfBuildTypesReachedException
- if maximum number of build configurations is reached.
-
createBuildType
@NotNull public BuildTypeEx createBuildType(@NotNull String extId, @NotNull String name, @Nullable Consumer<BuildTypeEx> init) throws DuplicateExternalIdException, DuplicateBuildTypeNameException, MaxNumberOfBuildTypesReachedException
- Specified by:
createBuildType
in interfaceProjectEx
- Overrides:
createBuildType
in classProjectImpl
- Throws:
DuplicateExternalIdException
DuplicateBuildTypeNameException
MaxNumberOfBuildTypesReachedException
-
addParameter
public void addParameter(@NotNull Parameter param)
Description copied from interface:UserParametersHolder
Adds parameter.- Specified by:
addParameter
in interfaceUserParametersHolder
- Overrides:
addParameter
in classProjectImpl
- Parameters:
param
- build or config parameter, the type is determined by parameter prefix
-
removeParameter
public void removeParameter(@NotNull String paramName)
Description copied from interface:UserParametersHolder
Removes parameter.- Specified by:
removeParameter
in interfaceUserParametersHolder
- Overrides:
removeParameter
in classProjectImpl
- Parameters:
paramName
- build or config parameter name, the type is determined by parameter prefix
-
createBuildTypeTemplate
@NotNull public BuildTypeTemplate createBuildTypeTemplate(@NotNull SBuildType originalBuildType, @NotNull String name, @NotNull CopyOptions copyOptions)
Description copied from interface:SProject
Extracts a template from the specified build type.- Specified by:
createBuildTypeTemplate
in interfaceSProject
- Overrides:
createBuildTypeTemplate
in classProjectImpl
- Parameters:
originalBuildType
- original templatename
- new template namecopyOptions
- options to control copy operation- Returns:
- new template
- See Also:
SProject.extractBuildTypeTemplate(SBuildType, String, String)
-
createBuildType
@NotNull public SBuildType createBuildType(@NotNull SBuildType originalBuildType, @NotNull String name, @NotNull CopyOptions copyOptions) throws MaxNumberOfBuildTypesReachedException
Description copied from interface:SProject
Creates new build configuration on the base of the specified original build configuration.- Specified by:
createBuildType
in interfaceSProject
- Overrides:
createBuildType
in classProjectImpl
- Parameters:
originalBuildType
- build configuration to copyname
- name to use for new configuration. If there exists configuration with same name in the target project then " (1)", " (2)", ... suffix will be added to the specified name.copyOptions
- additional options- Returns:
- build configuration copy
- Throws:
MaxNumberOfBuildTypesReachedException
- if maximum number of build configurations is reached- See Also:
SProject.copyBuildType(SBuildType, String, String, CopyOptions)
-
createBuildTypeFromTemplate
@NotNull public BuildTypeEx createBuildTypeFromTemplate(@NotNull BuildTypeTemplate template, @NotNull String extId, @NotNull String name) throws MaxNumberOfBuildTypesReachedException, DuplicateExternalIdException, InvalidVcsRootScopeException
Description copied from interface:SProject
Creates build configuration on the base of specified template.- Specified by:
createBuildTypeFromTemplate
in interfaceSProject
- Overrides:
createBuildTypeFromTemplate
in classProjectImpl
- Parameters:
template
- build configuration template.extId
- external identifier for the new build configuration.name
- name for the new build configuration.- Returns:
- new build configuration.
- Throws:
MaxNumberOfBuildTypesReachedException
- if maximum number of build configurations is reached.DuplicateExternalIdException
- if the given external identifier belongs to another build type (possible in another project).InvalidVcsRootScopeException
- if a VCS root cannot be attached to build configuration.
-
createBuildTypeFromTemplate
@NotNull public BuildTypeEx createBuildTypeFromTemplate(@NotNull BuildTypeTemplate template, @NotNull String extId, @NotNull String name, @Nullable Consumer<BuildTypeEx> init) throws MaxNumberOfBuildTypesReachedException, InvalidVcsRootScopeException, DuplicateExternalIdException
- Specified by:
createBuildTypeFromTemplate
in interfaceProjectEx
- Overrides:
createBuildTypeFromTemplate
in classProjectImpl
- Throws:
MaxNumberOfBuildTypesReachedException
InvalidVcsRootScopeException
DuplicateExternalIdException
-
createBuildTypeFromTemplate
@NotNull public SBuildType createBuildTypeFromTemplate(@NotNull BuildTypeTemplate template, @NotNull String name, @NotNull CopyOptions copyOptions) throws MaxNumberOfBuildTypesReachedException
Description copied from interface:SProject
Creates build configuration on the base of specified template.- Specified by:
createBuildTypeFromTemplate
in interfaceSProject
- Overrides:
createBuildTypeFromTemplate
in classProjectImpl
- Parameters:
template
- build configuration templatename
- name to use for build configuration. If there exists configuration with same name in the target project then " (1)", " (2)", ... suffix will be added to the specified name.copyOptions
- options to control copy operation- Returns:
- new build configuration
- Throws:
MaxNumberOfBuildTypesReachedException
- if maximum number of build configurations is reached- See Also:
SProject.createBuildTypeFromTemplate(BuildTypeTemplate, String, String)
-
findBuildTypeByName
@Nullable public SBuildType findBuildTypeByName(@NotNull String name)
Description copied from interface:SProject
Searches for a build configuration with specified name among own build configurations of this project (not in subprojects).- Specified by:
findBuildTypeByName
in interfaceSProject
- Overrides:
findBuildTypeByName
in classProjectImpl
- Parameters:
name
- name of the build configuration to look for.- Returns:
- found build configuration or null.
- See Also:
SProject.findBuildTypeByExternalId(String)
,SProject.findBuildTypeById(String)
-
removeBuildTypes
public void removeBuildTypes()
Description copied from class:ProjectImpl
Unregisters all build types and templates.- Specified by:
removeBuildTypes
in interfaceSProject
- Overrides:
removeBuildTypes
in classProjectImpl
-
setName
public void setName(@NotNull String name)
Description copied from interface:SProject
Renames project- Specified by:
setName
in interfaceSProject
- Overrides:
setName
in classProjectImpl
- Parameters:
name
- new project name
-
setDescription
public void setDescription(@Nullable String description)
Description copied from interface:SProject
Sets this project description- Specified by:
setDescription
in interfaceSProject
- Overrides:
setDescription
in classProjectImpl
- Parameters:
description
- new project description
-
setDefaultTemplate
public void setDefaultTemplate(@Nullable BuildTypeTemplate template)
- Specified by:
setDefaultTemplate
in interfaceProjectEx
- Overrides:
setDefaultTemplate
in classProjectImpl
-
getVcsRoots
@NotNull public List<SVcsRoot> getVcsRoots()
Description copied from interface:SProject
Returns all VCS roots associated with this project and all its subprojects transitively.- Specified by:
getVcsRoots
in interfaceBuildProject
- Specified by:
getVcsRoots
in interfaceSProject
- Overrides:
getVcsRoots
in classProjectImpl
- Returns:
- list of vcs roots
-
getVcsRootInstances
@NotNull public List<VcsRootInstance> getVcsRootInstances()
- Specified by:
getVcsRootInstances
in interfaceSProject
- Overrides:
getVcsRootInstances
in classProjectImpl
- Returns:
- all VCS root instances used in the project and subprojects.
-
setArchived
public void setArchived(boolean archived, @Nullable User user)
Description copied from interface:SProject
Sets project's and sub project's archived flags, pauses build configurations. Persists configuration changes on disk.- Specified by:
setArchived
in interfaceSProject
- Overrides:
setArchived
in classProjectImpl
- Parameters:
archived
- is the project archiveduser
- the user the performs the action
-
getAvailableTemplates
@NotNull public List<BuildTypeTemplate> getAvailableTemplates()
- Specified by:
getAvailableTemplates
in interfaceSProject
- Overrides:
getAvailableTemplates
in classProjectImpl
- Returns:
- list of templates available in this project, i.e. all templates of this project and all templates from parents.
-
setExternalId
public void setExternalId(@NotNull String newId) throws InvalidIdentifierException, DuplicateExternalIdException
Description copied from interface:SProject
Sets the external project id.All such project identifiers must be unique case insensitively.
This method performs persisting. You don't need to call persist when this method done.
- Specified by:
setExternalId
in interfaceSProject
- Overrides:
setExternalId
in classProjectImpl
- Parameters:
newId
- the new external project identifier.- Throws:
InvalidIdentifierException
DuplicateExternalIdException
-
setExternalId
public void setExternalId(@NotNull ConfigAction cause, @NotNull String newId) throws InvalidIdentifierException, DuplicateExternalIdException
Description copied from interface:SProject
Sets the external project id.All such project identifiers must be unique case insensitively.
This method performs persisting and changes the disk structure immediately. You don't need to call persist when this method done.
- Specified by:
setExternalId
in interfaceSProject
- Overrides:
setExternalId
in classProjectImpl
newId
- the new external project identifier.- Throws:
InvalidIdentifierException
DuplicateExternalIdException
-
moveToProject
public void moveToProject(@NotNull SProject target) throws CyclicDependencyException
Description copied from interface:SProject
Moves this project to the target project.- Specified by:
moveToProject
in interfaceSProject
- Overrides:
moveToProject
in classProjectImpl
- Parameters:
target
- new parent project for this project- Throws:
CyclicDependencyException
-
moveToProject
public void moveToProject(@NotNull ConfigAction cause, @NotNull SProject target) throws CyclicDependencyException, InvalidVcsRootScopeException
Description copied from interface:SProject
Moves this project to the target project.- Specified by:
moveToProject
in interfaceSProject
- Overrides:
moveToProject
in classProjectImpl
- Parameters:
cause
- config action caused the changetarget
- new parent project for this project- Throws:
CyclicDependencyException
InvalidVcsRootScopeException
-
copyVcsRoot
@NotNull public SVcsRootEx copyVcsRoot(@NotNull SVcsRoot originalRoot, @Nullable String externalId)
Description copied from interface:SProject
Creates a copy of original VCS root in this project.- Specified by:
copyVcsRoot
in interfaceProjectEx
- Specified by:
copyVcsRoot
in interfaceSProject
- Overrides:
copyVcsRoot
in classProjectImpl
- Parameters:
originalRoot
- original VCS root.externalId
- external id for the copy; if null the the external id will be generated automatically.- Returns:
- VCS root copy
-
createVcsRoot
@NotNull public SVcsRootEx createVcsRoot(@NotNull String vcsName, @Nullable String name, @NotNull Map<String,String> params)
Description copied from interface:SProject
Creates new VCS root in this project- Specified by:
createVcsRoot
in interfaceProjectEx
- Specified by:
createVcsRoot
in interfaceSProject
- Overrides:
createVcsRoot
in classProjectImpl
- Parameters:
vcsName
- name of VCS pluginname
- name of VCS root, if null or empty new name will be generated automaticallyparams
- VCS root parameters- Returns:
- newly created VCS root
-
createVcsRoot
@NotNull public SVcsRootEx createVcsRoot(@NotNull String vcsName, @NotNull String externalId, @NotNull String name) throws InvalidIdentifierException, DuplicateExternalIdException, DuplicateVcsRootNameException
Description copied from interface:SProject
Creates new VCS root in this project- Specified by:
createVcsRoot
in interfaceSProject
- Overrides:
createVcsRoot
in classProjectImpl
- Parameters:
vcsName
- name of VCS pluginexternalId
- VCS root external idname
- VCS root name- Returns:
- newly created VCS root
- Throws:
DuplicateExternalIdException
- if external IDDuplicateVcsRootNameException
- if provided VCS root name duplicates name of existing VCS rootInvalidIdentifierException
-
getBuildTypes
@NotNull public List<SBuildType> getBuildTypes()
Description copied from interface:SProject
Returns all build configurations registered in this project and all its subprojects (not only direct subprojects, but all).- Specified by:
getBuildTypes
in interfaceBuildProject
- Specified by:
getBuildTypes
in interfaceSProject
- Overrides:
getBuildTypes
in classProjectImpl
- Returns:
- list of build configurations sorted by name
-
createProjectNoAudit
@NotNull public ProjectEx createProjectNoAudit(@NotNull String externalId, @NotNull String projectName)
- Specified by:
createProjectNoAudit
in interfaceProjectEx
- Overrides:
createProjectNoAudit
in classProjectImpl
-
getBuildTypeTemplates
@NotNull public List<BuildTypeTemplate> getBuildTypeTemplates()
Description copied from interface:SProject
Returns all build configuration templates registered in this project and all its subprojects (not only direct).- Specified by:
getBuildTypeTemplates
in interfaceSProject
- Overrides:
getBuildTypeTemplates
in classProjectImpl
- Returns:
- list of build configuration templates sorted by name
-
addCleanupPolicy
public void addCleanupPolicy(@NotNull HistoryRetentionPolicy policy)
Description copied from interface:CleanupSettingsInit
Sets cleanup policy for this build configuration- Specified by:
addCleanupPolicy
in interfaceCleanupSettingsInit
- Overrides:
addCleanupPolicy
in classProjectImpl
- Parameters:
policy
- policy to set
-
removeCleanupPolicies
public void removeCleanupPolicies()
Description copied from interface:CleanupSettingsInit
Remove all own cleanup policies for the object- Specified by:
removeCleanupPolicies
in interfaceCleanupSettingsInit
- Overrides:
removeCleanupPolicies
in classProjectImpl
-
setCleanupOption
public void setCleanupOption(@NotNull String option, @Nullable Boolean value)
Description copied from interface:CleanupSettingsInit
Sets value for a cleanup option- Specified by:
setCleanupOption
in interfaceCleanupSettingsInit
- Overrides:
setCleanupOption
in classProjectImpl
- Parameters:
option
- cleanup option (seeCleanupSettings
constants)value
- value to set option to, ornull
to remove the option
-
setEditable
public void setEditable(boolean editable)
Description copied from interface:ProjectEx
Enables or disables editing of the project in web UI, see alsoSPersistentEntity.isReadOnly()
. Editing is enabled or disabled for the project itself and all nested entities unless it is overridden in the nested entity.SProject.persist()
method must be called afterwards.- Specified by:
setEditable
in interfaceProjectEx
- Overrides:
setEditable
in classProjectImpl
- Parameters:
editable
- true to enable editing and false to disable
-
addFeature
@NotNull public SProjectFeatureDescriptor addFeature(@NotNull String type, @NotNull Map<String,String> params)
Description copied from interface:SProject
Adds new project feature.- Specified by:
addFeature
in interfaceSProject
- Overrides:
addFeature
in classProjectImpl
- Parameters:
type
- type of the featureparams
- feature parameters- Returns:
- newly created object representing this project feature
-
addFeature
@NotNull public SProjectFeatureDescriptor addFeature(@NotNull String id, @NotNull String type, @NotNull Map<String,String> params)
Description copied from interface:SProject
Adds new project feature with provided ID if auto-generated ID is not desirable- Specified by:
addFeature
in interfaceSProject
- Overrides:
addFeature
in classProjectImpl
- Parameters:
id
- id of the featuretype
- type of the featureparams
- feature parameters- Returns:
- newly created object representing this project feature
-
addFeature
public void addFeature(@NotNull SProjectFeatureDescriptor feature)
Description copied from interface:SProject
Adds project feature. If the project feature doesn't belong to this project - a copy will be created.- Specified by:
addFeature
in interfaceSProject
- Overrides:
addFeature
in classProjectImpl
- Parameters:
feature
- project feature to add
-
removeFeature
@Nullable public SProjectFeatureDescriptor removeFeature(@NotNull String featureId)
Description copied from interface:SProject
Removes project feature with specified id.- Specified by:
removeFeature
in interfaceSProject
- Overrides:
removeFeature
in classProjectImpl
- Parameters:
featureId
- feature id- Returns:
- removed feature or null if there was no feature with such id
-
updateFeature
public boolean updateFeature(@NotNull String featureId, @NotNull String newType, @NotNull Map<String,String> newParams)
Description copied from interface:SProject
Updates type and parameters of project feature with specified id.- Specified by:
updateFeature
in interfaceSProject
- Overrides:
updateFeature
in classProjectImpl
- Parameters:
featureId
- feature idnewType
- new feature typenewParams
- new feature parameters- Returns:
- true if feature with specified id was found and updated
-
setOwnProjectsOrder
public void setOwnProjectsOrder(List<String> internalIds)
- Specified by:
setOwnProjectsOrder
in interfaceProjectEx
- Overrides:
setOwnProjectsOrder
in classProjectImpl
- Parameters:
internalIds
- Empty list will remove custom ordering
-
setOwnBuildTypesOrder
public void setOwnBuildTypesOrder(List<String> internalIds)
- Specified by:
setOwnBuildTypesOrder
in interfaceProjectEx
- Overrides:
setOwnBuildTypesOrder
in classProjectImpl
- Parameters:
internalIds
- Empty list will remove custom ordering
-
getOrCreateToken
@NotNull public String getOrCreateToken(@NotNull String secret, @NotNull String contextDescription)
Description copied from interface:SecureTokensProducer
For a specified secret (password, API key, etc) creates a token which can be used in project settings instead. Token and secret are persisted in the internal storage, next time when this method is called for the same secret, the same token is returned.- Specified by:
getOrCreateToken
in interfaceSecureTokensProducer
- Overrides:
getOrCreateToken
in classProjectImpl
- Parameters:
secret
- some secure valuecontextDescription
- human friendly description of context in which secret is accessed; this context is later used in health report, when secret cannot be restored by provided token- Returns:
- token to use instead of secret
-
setEnforcedSettings
public void setEnforcedSettings(@Nullable ProjectEnforcedSettings enforcedSettings)
Description copied from interface:ProjectEx
Attach enforced settings profile to this project. Neither configurations nor templates nor subproject would be reloaded at this moment, however new enforced settings will be applied immediately (will be read at first access).
- Specified by:
setEnforcedSettings
in interfaceProjectEx
- Overrides:
setEnforcedSettings
in classProjectImpl
-
-