Class ProjectImpl
- java.lang.Object
-
- jetbrains.buildServer.serverSide.impl.projects.ProjectImpl
-
- All Implemented Interfaces:
Comparable<BuildProject>,BuildProject,Loggable,CleanupSettings,CleanupSettingsInit,ParameterSupport,ProjectEx,SecureDataStorage,SecureTokensProducer,InheritableUserParametersHolder,InheritableUserParametersHolderEx,InternalParameters,ParametersSupport,ReadOnlyUserParameters,SPersistentEntity,SProject,UserParametersHolder
- Direct Known Subclasses:
SecuredProject
public class ProjectImpl extends Object implements ProjectEx
-
-
Nested Class Summary
Nested Classes Modifier and Type Class Description static classProjectImpl.Cached<T>
-
Field Summary
Fields Modifier and Type Field Description static StringAUTOMATIC_ARCHIVE_COMMENTstatic StringAUTOMATIC_DEARCHIVE_COMMENTstatic StringAUTOMATIC_PAUSE_COMMENTstatic StringAUTOMATIC_UNPAUSE_COMMENTstatic StringPROJECT_CREDENTIALS_STORAGE_PROP_NAMEstatic StringTEAMCITY_SETTINGS_READ_ONLY_PARAMstatic StringTEAMCITY_SETTINGS_RUN_BUTTON_CAPTION_PARAMstatic StringTEAMCITY_VIRTUAL_PROJECT_PARAMstatic StringVERSIONED_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 ProjectImpl(EntityId<String> id, String parentInternalId, String name, ProjectDataModel model, ProjectContext projectContext, boolean emptyUuid)
-
Method Summary
All Methods Instance Methods Concrete Methods Deprecated Methods Modifier and Type Method Description voidaddBuildTypeTemplate(BuildTypeTemplateEx template)Stores build type template in the project, should be used when templates are loaded from configuration files.voidaddCleanupPolicy(HistoryRetentionPolicy policy)Sets cleanup policy for this build configurationvoidaddDefaultTemplateListener()SProjectFeatureDescriptoraddFeature(String id, String type, Map<String,String> params)Adds new project feature with provided ID if auto-generated ID is not desirableSProjectFeatureDescriptoraddFeature(String type, Map<String,String> params)Adds new project feature.voidaddFeature(SProjectFeatureDescriptor feature)Adds project feature.voidaddParameter(Parameter param)Adds parameter.voidattachedToModel(ProjectDataModel model)voidattachEnforcedSettings(BuildTypeTemplate typeTemplateEx)booleanbelongsTo(SProject project)Returns true if the specified project is or contains (including transitively) this project.voidbuildTypeCreated(SBuildType newBuildType, SBuildType originalBuildType, BuildTypeTemplate template)voidcheckCyclicDependencies(SBuildType buildType)Checks if a build type added or moved to the given project creates a cyclic snapshot dependency due to some dependencies defined in the project's effective default templatevoidcheckCyclicDependency(Collection<SBuildType> buildTypes, Dependency dependency)Checks if a snapshot dependency creates a cycle if added to the provided build type.voidclearDefaultTemplateIdCacheForSelfAndChildren()voidclearProjectPathCache()intcompareTo(BuildProject o)booleancontainsBuildType(String buildTypeId)Returns true if this project or one of subprojects has own build configuration with specified id.SBuildTypecopyBuildType(SBuildType originalBuildType, String extId, String name, CopyOptions copyOptions)Creates a copy of the given build configuration.SBuildTypecopyBuildType(SBuildType originalBuildType, String extId, String name, CopyOptions copyOptions, BuildTypeCopyMap copiedObjects)BuildTypeTemplatecopyBuildTypeTemplate(BuildTypeTemplate original, String extId, String name)Creates new template by copying settings from the original one.BuildTypeTemplateExcopyTemplate(BuildTypeTemplateEx template, String extId, String name, CopyOptions options)SVcsRootExcopyVcsRoot(SVcsRoot originalRoot, String externalId)Creates a copy of original VCS root in this project.BuildTypeExcreateBuildType(String name)Creates new build configuration with given nameBuildTypeExcreateBuildType(String extId, String name)Creates new build configuration with given external identifier and name.BuildTypeExcreateBuildType(String name, String runnerType, int maxBuilds, BuildTypeDescriptor.CheckoutType checkoutType)Creates a new build configurationBuildTypeExcreateBuildType(String extId, String name, Consumer<BuildTypeEx> init)BuildTypeExcreateBuildType(EntityId<String> entityId, boolean emptyUuid, String name, Consumer<BuildTypeEx> init)SBuildTypecreateBuildType(SBuildType originalBuildType, String newConfigurationName, boolean copyVcsRoots, boolean changeScopeOfLocalVcsRoots)SBuildTypecreateBuildType(SBuildType originalBuildType, String newName, CopyOptions copyOptions)Creates new build configuration on the base of the specified original build configuration.BuildTypeExcreateBuildTypeFromTemplate(BuildTypeTemplate template, String extId, String name)Creates build configuration on the base of specified template.BuildTypeExcreateBuildTypeFromTemplate(BuildTypeTemplate template, String extId, String name, Consumer<BuildTypeEx> init)SBuildTypecreateBuildTypeFromTemplate(BuildTypeTemplate template, String name, CopyOptions copyOptions)Creates build configuration on the base of specified template.BuildTypeTemplateExcreateBuildTypeTemplate(String name)Creates new build configuration template.BuildTypeTemplateExcreateBuildTypeTemplate(String extId, String name)Creates new build configuration template with given external identifier an name.BuildTypeTemplatecreateBuildTypeTemplate(BuildTypeTemplate original, String name, CopyOptions copyOptions)Creates new template by copying settings from the original one.BuildTypeTemplatecreateBuildTypeTemplate(SBuildType originalBuildType, String name, CopyOptions copyOptions)Extracts a template from the specified build type.ConfigActionExcreateConfigAction(SUser user, String description)Creates a config action instance associated with this entity and having the specified description.SVcsRootcreateDummyVcsRoot(String vcsName, Map<String,String> parameters)Creates a dummy VCS root which cannot be persisted, but can be used in cases when project specific VCS operation must be performed.ProjectExcreateProject(String externalId, String projectName)Creates new sub project in this projectProjectExcreateProjectNoAudit(String externalId, String projectName)ProjectExcreateProjectNoAudit(String externalId, String projectName, boolean archived)SVcsRootExcreateVcsRoot(String vcsName, String externalId, String name)Creates new VCS root in this projectSVcsRootExcreateVcsRoot(String vcsName, String name, Map<String,String> params)Creates new VCS root in this projectProjectExcreateVirtualProject(String externalId, String projectName)Stringdescribe(boolean verbose)voiddispose()Must be called when this project object is removed from the model.booleanequals(Object that)BuildTypeTemplateextractBuildTypeTemplate(SBuildType originalBuildType, String extId, String name)Extracts a template from the specified build type.SBuildTypefindBuildTypeByExternalId(String externalId)Searches for a build configuration in this and nested projects by the specified external id.BuildTypeImplfindBuildTypeById(String internalId)Searches for a build configuration in this and nested projects by the specified internal id.SBuildTypefindBuildTypeByName(String name)Searches for a build configuration with specified name among own build configurations of this project (not in subprojects).BuildTypeIdentityfindBuildTypeIdentityByName(String name)Looks for a build template or a configuration with specified name among own build template and configurations of this project.BuildTypeTemplatefindBuildTypeTemplateByExternalId(String extId)Searches for build type template by given external id in this and nested project.BuildTypeTemplatefindBuildTypeTemplateById(String intId)Searches for build type template by given internal id in this and nested projects.BuildTypeTemplatefindBuildTypeTemplateByName(String name)Searches for a template with specified name in this project (not in subprojects).SProjectFeatureDescriptorfindFeatureById(String featureId)Finds project feature by id.FilefindPluginSettings(String pluginName, String fileNme)Search for a plugin settings file for given project.ProjectExfindProjectByName(String projectName)Returns own sub project with specified name (case insensitive) or null if there is no such project.SVcsRootfindVcsRootByName(String name)Returns own VCS root with given name or null if project does not have such VCS rootList<AgentPool>getAgentPools()Return list of Agent Pool this project is associated with.DategetArchivingTime()Returns the date when the project was archived.UsergetArchivingUser()Returns the user who archived the project.List<File>getArtifactDirectories()FilegetArtifactsDirectory()Returns directory containing all of the project artifacts.Collection<SProjectFeatureDescriptor>getAvailableFeatures()Collection<SProjectFeatureDescriptor>getAvailableFeaturesOfType(String type)List<BuildTypeTemplate>getAvailableTemplates()List<SVcsRoot>getAvailableVcsRoots()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).Map<String,Boolean>getCleanupOptions()Collection<HistoryRetentionPolicy>getCleanupPolicies()List<SUser>getCommitters(int periodInSeconds)Returns committers to this project for the specified period (in seconds).FilegetConfigDirectory()Returns this project configuration directory, i.e.StringgetConfigId()Returns the entity's config identifier.FilegetConfigurationFile()Returns this project configuration file, named "project-config.xml" in project configuration directoryFilegetConfigurationFile(File projectsDir)Returns the configuration file where this entity is persisted in custom projects directoryCredentialsStoragegetCredentialsStorage()StringgetCredentialsStorageType()CustomDataStoragegetCustomDataStorage(String storageId)Returns a custom data storage for the given storage id associated with this projectBuildTypeTemplateExgetDefaultTemplate()Returns a default template effective in the projectStringgetDefaultTemplateId()Returns an internal id of a default template effective in the projectStringgetDescription()Returns project descriptionStringgetEditableSettingsNote()Returns admin area header note text to be shown if this project is editable or null if no note should be shownProjectSettingsGeneratorgetEffectiveGenerator()Same asVersionedSettingsManager.getEffectiveGenerator(SProject), but returns null if generator is not found instead of throwing an errorEnforcedSettingsgetEnforcedSettings()StringgetExtendedFullName()Returns the full name of the project with additional note if the project is archived, i.e.StringgetExtendedName()Returns the name of the project with additional note if the project is archived, i.e.StringgetExternalId()Returns the external project identifier.StringgetFullName()Returns project full name in the form: <parent project name> / <parent project name> / ...EntityId<String>getId()Returns the project id.Map<String,Boolean>getInheritedCleanupOptions()Collection<HistoryRetentionPolicy>getInheritedCleanupPolicies()Collection<Parameter>getInheritedParametersCollection()AuditLogActiongetLastConfigModificationAction()protected BuildServerListenergetMulticaster()StringgetName()Returns project nameStringgetNextAvailableFeatureId(String type, Map<String,String> params)Returns a generated ID that will be used by the next feature added to this projectStringgetOrCreateToken(String secret, String contextDescription)For a specified secret (password, API key, etc) creates a token which can be used in project settings instead.SProjectgetOrganizationProject()List<Parameter>getOwnAndParentsNonInheritedParameter(String paramName)Own should be last.List<Collection<Parameter>>getOwnAndParentsNonInheritedParameters()Own should be last.List<SBuildType>getOwnBuildTypes()Returns all build configurations registered in this certain project.List<SBuildType>getOwnBuildTypesOrder()Unlike SProject.getOwnBuildTypes() could return partial list of Build Types (if custom ordering is partial)List<BuildTypeTemplate>getOwnBuildTypeTemplates()Returns build configuration templates registered in this certain project.Map<String,Boolean>getOwnCleanupOptions()Collection<HistoryRetentionPolicy>getOwnCleanupPolicies()CleanupSettingsSupportgetOwnCleanupSettingsSupport()BuildTypeTemplateExgetOwnDefaultTemplate()Returns a default template defined in the projectStringgetOwnDefaultTemplateExternalId()StringgetOwnDefaultTemplateId()Returns an internal id of a default template defined in the projectProjectEnforcedSettingsgetOwnEnforcedSettings()Collection<SProjectFeatureDescriptor>getOwnFeatures()Collection<SProjectFeatureDescriptor>getOwnFeaturesOfType(String type)ParametergetOwnNonInheritedParameter(String paramName)Own parameter without inherited parameter spec.ParametergetOwnParameter(String paramName)Map<String,String>getOwnParameters()Collection<Parameter>getOwnParametersCollection()Collection<Parameter>getOwnParametersWithoutInheritedSpec()List<SProject>getOwnProjects()Returns only own sub projects of this project.List<SProject>getOwnProjectsOrder()Unlike SProject.getOwnProjects() could return partial list of Projects (if custom ordering is partial)SerializableParametersCollectiongetOwnSerializableParameters()List<SVcsRoot>getOwnVcsRoots()Returns VCS roots associated with this certain project.ParametergetParameter(String paramName)Map<String,String>getParameters()Returns map of build and configuration parameters.Collection<Parameter>getParametersCollection()Returns build and configuration parameters in single collection.ParametersProvidergetParametersProvider()Returns parameters which can be used by value resolver.ContainerWithInherited<String,Parameter>getParametersSupport()StringgetParameterValue(String paramName)SPersistentEntitygetParent()The parent entity.ProjectExgetParentProject()Returns the parent of this project.StringgetParentProjectExternalId()Returns external id of the parent project of this project.StringgetParentProjectId()Returns internal id of the parent project of this project.FilegetPluginDataDirectory(String pluginName)Returns plugin data directory for given plugin nameFilegetPluginSettingsFile()Returns the plugin settings file for this project scope settings.List<User>getPotentiallyResponsibleUsers()Returns the list of users who potentially can be responsible for failures in this project.ProjectDataModelgetProjectDataModel()StringgetProjectId()Returns the internal project identifier.List<SProject>getProjectPath()The tree path in project hierarchy from the root project to this one (in other words, all parents of this and this one).List<SProject>getProjects()Returns all sub projects of this project transitively.ReadOnlyReasongetReadOnlyReason()StringgetSecureValue(String token, String contextDescription)Returns a secret (password, API key, etc) associated with this project and token, or the same token if there is no such secret.Pair<VcsRootInstance,BranchSpec>getSettingsRootSpec()Returns last used versioned settings VCS root and its branch spec or null if this information is not found project's custom data storageStatusgetStatus()Returns project status calculated according to cumulative status of all build configurations registered in the project.StatusgetStatus(String branch)StringgetTokenContext(String token)Map<String,String>getTokensWithoutSecret()List<SVcsRoot>getUsedVcsRoots()ValueResolvergetValueResolver()Returns value resolver which can be used to resolve references in valuesList<VcsRootInstance>getVcsRootInstances()List<SVcsRoot>getVcsRoots()Returns all VCS roots associated with this project and all its subprojects transitively.PersistentEntityVersiongetVersion()Returns version of this entity which can be used to check if the entity was edited or persisted.SVcsRootgetVersionedSettingsVcsRoot()List<SBuildType>getVirtualBuildTypes()booleanhasBuildTypes()Returns true if this project contains at least one own build configurationinthashCode()booleanhasSettingsWithSecureValues()booleanhasVersionedSettings()Returns true if this project stores its settings in VCS, false otherwisevoidinit(ProjectExternalizer externalizer)voidinitArchivedStatus(boolean archived)Initializes project's archived flag.booleanisArchived()Returns true if the project is archivedbooleanisDefaultBranchExcluded()Returns true if all project's own buildTypes exclude the default branch.booleanisEmptyUuid()booleanisExtIdChangeSupported()Returns true if extId can be changed in this project and all its entitiesbooleanisInModel()Return true if this project is attached to the TeamCity project model.booleanisMoveEntitiesSupported()Returns true if project settings format supports move of entities in projects hierarchybooleanisMoveSupported()Returns true if project settings format supports move of the project with all its entities in projects hierarchybooleanisProjectCreateSupported()Returns true if format supports new project creationbooleanisProjectDeleteSupported()Returns true if project settings format supports delete of the projectbooleanisReadOnly()booleanisRootProject()Returns true iff this project is root projectbooleanisVirtual()Returns true for so-called virtual projects.voidmarkPersisted(long expectedEditId)Marks entity as persistedvoidmoveToProject(ConfigAction cause, SProject target)Moves this project to the target project.voidmoveToProject(SProject target)Moves this project to the target project.voidpersist()Persists this project configuration on disk.voidpersist(ConfigAction cause)Persists this entity on disk.voidremove()Removes this entity.voidremoveBuildType(String internalId)Removes build configuration with specified internal idvoidremoveBuildTypes()Unregisters all build types and templates.voidremoveBuildTypeTemplate(String internalId)Deprecated.voidremoveCleanupPolicies()Remove all own cleanup policies for the objectvoidremoveDefaultTemplateListener()SProjectFeatureDescriptorremoveFeature(String featureId)Removes project feature with specified id.voidremoveParameter(String paramName)Removes parameter.booleanreplaceInValues(Pattern regexp, String replacement)Processes project settings and replaces all values matched by regexp to specified replacement string.protected voidresetCachedReadOnlyReason(boolean resetInSubProjects)voidresortBuildTypes()Resorts build configurations containedbooleansaveSettingsBranchSpec(VcsRootInstance root, BranchSpec spec)Updates versioned settings root and branch spec last used for changes collecting.PersistTaskscheduleFileDelete(ConfigAction cause, String pathInProjectDir)PersistTaskscheduleFileSave(ConfigAction cause, String pathInProjectDir, byte[] fileContent)BackgroundPersistTaskschedulePersisting(String reason)Schedules background persisting of this entity settings.BackgroundPersistTaskschedulePersisting(ConfigAction cause)Schedules background persisting of this project settings.voidscheduleProjectConfigurationReload()Schedules background task to reload project configuration from disk.PersistTaskscheduleRemove(ConfigAction cause)Schedules remove of this persistent entity.voidsendExtIdChangedEvents(ConfigAction cause, String oldExternalId, String newExternalId)voidsetArchived(boolean archived, User user)Sets project's and sub project's archived flags, pauses build configurations.voidsetCleanupOption(String option, Boolean value)Sets value for a cleanup optionvoidsetDefaultTemplate(BuildTypeTemplate template)voidsetDescription(String description)Sets this project descriptionvoidsetEditable(boolean editable)Enables or disables editing of the project in web UI, see alsoSPersistentEntity.isReadOnly().voidsetEnforcedSettings(ProjectEnforcedSettings enforcedSettings)Attach enforced settings profile to this project.voidsetExternalId(String newId)Sets the external project id.voidsetExternalId(ConfigAction cause, String newId)Sets the external project id.voidsetExternalId(ConfigAction cause, String newId, boolean sendEvents)voidsetName(String name)Renames projectvoidsetOwnBuildTypesOrder(List<String> internalIds)voidsetOwnProjectsOrder(List<String> internalIds)voidstoreBuildType(BuildTypeImpl buildType)StringtoString()voidunregister()Tries to unregister this project from the model.booleanupdateFeature(String featureId, String newType, Map<String,String> newParams)Updates type and parameters of project feature with specified id.voidupdateParentInternally(EntityId<String> newParentId)voidvalidateNewExtId(String extId)Validates the given extId in this project-
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
-
-
-
-
Field Detail
-
TEAMCITY_SETTINGS_READ_ONLY_PARAM
public static final String TEAMCITY_SETTINGS_READ_ONLY_PARAM
- See Also:
- Constant Field Values
-
TEAMCITY_SETTINGS_RUN_BUTTON_CAPTION_PARAM
public static final String TEAMCITY_SETTINGS_RUN_BUTTON_CAPTION_PARAM
- See Also:
- Constant Field Values
-
TEAMCITY_VIRTUAL_PROJECT_PARAM
public static final String TEAMCITY_VIRTUAL_PROJECT_PARAM
- See Also:
- Constant Field Values
-
VERSIONED_SETTINGS_STORAGE_KEY
public static final String VERSIONED_SETTINGS_STORAGE_KEY
- See Also:
- Constant Field Values
-
PROJECT_CREDENTIALS_STORAGE_PROP_NAME
public static final String PROJECT_CREDENTIALS_STORAGE_PROP_NAME
- See Also:
- Constant Field Values
-
AUTOMATIC_PAUSE_COMMENT
public static final String AUTOMATIC_PAUSE_COMMENT
- See Also:
- Constant Field Values
-
AUTOMATIC_UNPAUSE_COMMENT
public static final String AUTOMATIC_UNPAUSE_COMMENT
- See Also:
- Constant Field Values
-
AUTOMATIC_ARCHIVE_COMMENT
public static final String AUTOMATIC_ARCHIVE_COMMENT
- See Also:
- Constant Field Values
-
AUTOMATIC_DEARCHIVE_COMMENT
public static final String AUTOMATIC_DEARCHIVE_COMMENT
- See Also:
- Constant Field Values
-
-
Constructor Detail
-
ProjectImpl
public ProjectImpl(@NotNull EntityId<String> id, @Nullable String parentInternalId, @NotNull String name, @NotNull ProjectDataModel model, @NotNull ProjectContext projectContext, boolean emptyUuid)
-
-
Method Detail
-
init
public void init(@NotNull ProjectExternalizer externalizer)
-
getConfigurationFile
@NotNull public File getConfigurationFile()
Description copied from interface:SProjectReturns this project configuration file, named "project-config.xml" in project configuration directory- Specified by:
getConfigurationFilein interfaceSPersistentEntity- Specified by:
getConfigurationFilein interfaceSProject- Returns:
- this project configuration file
-
getConfigurationFile
@NotNull public File getConfigurationFile(@NotNull File projectsDir)
Description copied from interface:SPersistentEntityReturns the configuration file where this entity is persisted in custom projects directory- Specified by:
getConfigurationFilein interfaceSPersistentEntity- Parameters:
projectsDir- path to teamcity projects directory- Returns:
- see above
-
getPluginSettingsFile
@NotNull public File getPluginSettingsFile()
Description copied from interface:SProjectReturns the plugin settings file for this project scope settings.- Specified by:
getPluginSettingsFilein interfaceSProject- Returns:
- see plugin settings file (an XML file).
-
containsBuildType
public boolean containsBuildType(@NotNull String buildTypeId)Description copied from interface:SProjectReturns true if this project or one of subprojects has own build configuration with specified id.- Specified by:
containsBuildTypein interfaceSProject- Parameters:
buildTypeId- internal id of the build configuration.- Returns:
- true if the build type specified with the given id belongs to this project or its subprojects.
- See Also:
BuildTypeIdentity.belongsTo(SProject)
-
createBuildType
@NotNull public BuildTypeEx createBuildType(@NotNull String extId, @NotNull String name) throws DuplicateBuildTypeNameException, MaxNumberOfBuildTypesReachedException
Description copied from interface:ProjectExCreates new build configuration with given external identifier and name.- Specified by:
createBuildTypein interfaceProjectEx- Specified by:
createBuildTypein interfaceSProject- 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:
createBuildTypein interfaceProjectEx- Throws:
DuplicateExternalIdExceptionDuplicateBuildTypeNameExceptionMaxNumberOfBuildTypesReachedException
-
createBuildType
@NotNull public BuildTypeEx createBuildType(@NotNull EntityId<String> entityId, boolean emptyUuid, @NotNull String name, @Nullable Consumer<BuildTypeEx> init) throws DuplicateExternalIdException, DuplicateBuildTypeNameException, MaxNumberOfBuildTypesReachedException
- Specified by:
createBuildTypein interfaceProjectEx- Throws:
DuplicateExternalIdExceptionDuplicateBuildTypeNameExceptionMaxNumberOfBuildTypesReachedException
-
createBuildType
@NotNull public BuildTypeEx createBuildType(@NotNull String name) throws DuplicateBuildTypeNameException, MaxNumberOfBuildTypesReachedException
Description copied from interface:SProjectCreates new build configuration with given name- Specified by:
createBuildTypein interfaceProjectEx- Specified by:
createBuildTypein interfaceSProject- 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)
-
validateNewExtId
public void validateNewExtId(@NotNull String extId)Description copied from interface:ProjectExValidates the given extId in this project- Specified by:
validateNewExtIdin interfaceProjectEx- Parameters:
extId- id to validate
-
scheduleProjectConfigurationReload
public void scheduleProjectConfigurationReload()
Description copied from interface:ProjectExSchedules background task to reload project configuration from disk.- Specified by:
scheduleProjectConfigurationReloadin interfaceProjectEx
-
createBuildType
@NotNull public BuildTypeEx createBuildType(@NotNull String name, @NotNull String runnerType, int maxBuilds, BuildTypeDescriptor.CheckoutType checkoutType) throws DuplicateBuildTypeNameException, MaxNumberOfBuildTypesReachedException
Description copied from interface:SProjectCreates a new build configuration- Specified by:
createBuildTypein interfaceProjectEx- Specified by:
createBuildTypein interfaceSProject- Parameters:
name- name of the build configurationrunnerType- type of the runnermaxBuilds- maximum number of buildscheckoutType- type of the checkout- 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)
-
createBuildTypeTemplate
@NotNull public BuildTypeTemplateEx createBuildTypeTemplate(@NotNull String extId, @NotNull String name) throws DuplicateTemplateNameException, DuplicateExternalIdException
Description copied from interface:SProjectCreates new build configuration template with given external identifier an name.- Specified by:
createBuildTypeTemplatein interfaceProjectEx- Specified by:
createBuildTypeTemplatein interfaceSProject- 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.
-
createBuildTypeTemplate
@NotNull public BuildTypeTemplateEx createBuildTypeTemplate(@NotNull String name)
Description copied from interface:SProjectCreates new build configuration template.- Specified by:
createBuildTypeTemplatein interfaceProjectEx- Specified by:
createBuildTypeTemplatein interfaceSProject- Parameters:
name- name of the template- Returns:
- newly created template
- See Also:
SProject.createBuildTypeTemplate(String, String)
-
isInModel
public boolean isInModel()
Description copied from interface:SProjectReturn true if this project is attached to the TeamCity project model.
-
getPotentiallyResponsibleUsers
public List<User> getPotentiallyResponsibleUsers()
Description copied from interface:SProjectReturns the list of users who potentially can be responsible for failures in this project.- Specified by:
getPotentiallyResponsibleUsersin interfaceSProject- Returns:
- users who committed to this project within last 5 days.
-
findProjectByName
@Nullable public ProjectEx findProjectByName(@NotNull String projectName)
Description copied from interface:SProjectReturns own sub project with specified name (case insensitive) or null if there is no such project.- Specified by:
findProjectByNamein interfaceProjectEx- Specified by:
findProjectByNamein interfaceSProject- Parameters:
projectName- name of the project to look for- Returns:
- a project or null if such a sub project does not exist
-
createProject
@NotNull public ProjectEx createProject(@NotNull String externalId, @NotNull String projectName) throws InvalidIdentifierException, InvalidNameException, DuplicateProjectNameException, DuplicateExternalIdException
Description copied from interface:SProjectCreates new sub project in this project- Specified by:
createProjectin interfaceProjectEx- Specified by:
createProjectin interfaceSProject- Parameters:
externalId- new sub project idprojectName- new sub project name- Returns:
- newly created sub project
- Throws:
InvalidIdentifierExceptionInvalidNameExceptionDuplicateProjectNameExceptionDuplicateExternalIdException
-
createVirtualProject
public ProjectEx createVirtualProject(@NotNull String externalId, @NotNull String projectName)
- Specified by:
createVirtualProjectin interfaceProjectEx
-
createProjectNoAudit
@NotNull public ProjectEx createProjectNoAudit(@NotNull String externalId, @NotNull String projectName, boolean archived) throws InvalidIdentifierException, InvalidNameException, DuplicateProjectNameException, DuplicateExternalIdException
- Specified by:
createProjectNoAuditin interfaceProjectEx- Throws:
InvalidIdentifierExceptionInvalidNameExceptionDuplicateProjectNameExceptionDuplicateExternalIdException
-
createProjectNoAudit
@NotNull public ProjectEx createProjectNoAudit(@NotNull String externalId, @NotNull String projectName) throws InvalidIdentifierException, InvalidNameException, DuplicateProjectNameException, DuplicateExternalIdException
- Specified by:
createProjectNoAuditin interfaceProjectEx- Throws:
InvalidIdentifierExceptionInvalidNameExceptionDuplicateProjectNameExceptionDuplicateExternalIdException
-
createBuildType
@NotNull public SBuildType createBuildType(SBuildType originalBuildType, String newConfigurationName, boolean copyVcsRoots, boolean changeScopeOfLocalVcsRoots) throws MaxNumberOfBuildTypesReachedException
- Specified by:
createBuildTypein interfaceSProject- Throws:
MaxNumberOfBuildTypesReachedException
-
copyBuildTypeTemplate
@NotNull public BuildTypeTemplate copyBuildTypeTemplate(@NotNull BuildTypeTemplate original, @NotNull String extId, @NotNull String name)
Description copied from interface:SProjectCreates new template by copying settings from the original one.- Specified by:
copyBuildTypeTemplatein interfaceSProject- Parameters:
original- original templateextId- new external identifier.name- new template name- Returns:
- new template
-
createBuildTypeTemplate
@NotNull public BuildTypeTemplate createBuildTypeTemplate(@NotNull BuildTypeTemplate original, @NotNull String name, @NotNull CopyOptions copyOptions)
Description copied from interface:SProjectCreates new template by copying settings from the original one.- Specified by:
createBuildTypeTemplatein interfaceSProject- Parameters:
original- original templatename- new template namecopyOptions- options to control copy operation- Returns:
- new template
- See Also:
SProject.copyBuildTypeTemplate(BuildTypeTemplate, String, String)
-
extractBuildTypeTemplate
@NotNull public BuildTypeTemplate extractBuildTypeTemplate(@NotNull SBuildType originalBuildType, @NotNull String extId, @NotNull String name) throws DuplicateExternalIdException
Description copied from interface:SProjectExtracts a template from the specified build type.- Specified by:
extractBuildTypeTemplatein interfaceSProject- 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.
-
createBuildTypeTemplate
@NotNull public BuildTypeTemplate createBuildTypeTemplate(@NotNull SBuildType originalBuildType, @NotNull String name, @NotNull CopyOptions copyOptions)
Description copied from interface:SProjectExtracts a template from the specified build type.- Specified by:
createBuildTypeTemplatein interfaceSProject- Parameters:
originalBuildType- original templatename- new template namecopyOptions- options to control copy operation- Returns:
- new template
- See Also:
SProject.extractBuildTypeTemplate(SBuildType, String, String)
-
copyTemplate
@NotNull public BuildTypeTemplateEx copyTemplate(@NotNull BuildTypeTemplateEx template, @NotNull String extId, @NotNull String name, @NotNull CopyOptions options) throws DuplicateExternalIdException
- Specified by:
copyTemplatein interfaceProjectEx- Throws:
DuplicateExternalIdException
-
copyBuildType
@NotNull public SBuildType copyBuildType(@NotNull SBuildType originalBuildType, @NotNull String extId, @NotNull String name, @NotNull CopyOptions copyOptions) throws MaxNumberOfBuildTypesReachedException, DuplicateExternalIdException
Description copied from interface:SProjectCreates a copy of the given build configuration.- Specified by:
copyBuildTypein interfaceSProject- 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
-
copyBuildType
@NotNull public SBuildType copyBuildType(@NotNull SBuildType originalBuildType, @NotNull String extId, @NotNull String name, @NotNull CopyOptions copyOptions, @NotNull BuildTypeCopyMap copiedObjects) throws MaxNumberOfBuildTypesReachedException, DuplicateExternalIdException
- Specified by:
copyBuildTypein interfaceProjectEx- Throws:
MaxNumberOfBuildTypesReachedExceptionDuplicateExternalIdException
-
createBuildType
@NotNull public SBuildType createBuildType(@NotNull SBuildType originalBuildType, @NotNull String newName, @NotNull CopyOptions copyOptions) throws MaxNumberOfBuildTypesReachedException, InvalidVcsRootScopeException
Description copied from interface:SProjectCreates new build configuration on the base of the specified original build configuration.- Specified by:
createBuildTypein interfaceSProject- Parameters:
originalBuildType- build configuration to copynewName- 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 reachedInvalidVcsRootScopeException- if a VCS root cannot be attached to build configuration- See Also:
SProject.copyBuildType(SBuildType, String, String, CopyOptions)
-
buildTypeCreated
public void buildTypeCreated(@NotNull SBuildType newBuildType, @Nullable SBuildType originalBuildType, @Nullable BuildTypeTemplate template)
-
createBuildTypeFromTemplate
@NotNull public BuildTypeEx createBuildTypeFromTemplate(@NotNull BuildTypeTemplate template, @NotNull String extId, @NotNull String name) throws MaxNumberOfBuildTypesReachedException, DuplicateExternalIdException, InvalidVcsRootScopeException
Description copied from interface:SProjectCreates build configuration on the base of specified template.- Specified by:
createBuildTypeFromTemplatein interfaceSProject- 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:
createBuildTypeFromTemplatein interfaceProjectEx- Throws:
MaxNumberOfBuildTypesReachedExceptionInvalidVcsRootScopeExceptionDuplicateExternalIdException
-
createBuildTypeFromTemplate
@NotNull public SBuildType createBuildTypeFromTemplate(@NotNull BuildTypeTemplate template, @NotNull String name, @NotNull CopyOptions copyOptions) throws MaxNumberOfBuildTypesReachedException, InvalidVcsRootScopeException
Description copied from interface:SProjectCreates build configuration on the base of specified template.- Specified by:
createBuildTypeFromTemplatein interfaceSProject- 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 reachedInvalidVcsRootScopeException- if a VCS root cannot be attached to build configuration- See Also:
SProject.createBuildTypeFromTemplate(BuildTypeTemplate, String, String)
-
storeBuildType
public void storeBuildType(@NotNull BuildTypeImpl buildType) throws DuplicateBuildTypeIdException- Throws:
DuplicateBuildTypeIdException
-
findBuildTypeIdentityByName
@Nullable public BuildTypeIdentity findBuildTypeIdentityByName(@NotNull String name)
Description copied from interface:SProjectLooks for a build template or a configuration with specified name among own build template and configurations of this project.- Specified by:
findBuildTypeIdentityByNamein interfaceSProject- Parameters:
name- name of the build template or configuration to look for, case insensitive.- Returns:
- found build template of configuration, or null if not found.
- See Also:
SProject.findBuildTypeTemplateByName(java.lang.String),SProject.findBuildTypeByName(java.lang.String)
-
findBuildTypeByName
@Nullable public SBuildType findBuildTypeByName(@NotNull String name)
Description copied from interface:SProjectSearches for a build configuration with specified name among own build configurations of this project (not in subprojects).- Specified by:
findBuildTypeByNamein interfaceSProject- Parameters:
name- name of the build configuration to look for.- Returns:
- found build configuration or null.
- See Also:
SProject.findBuildTypeByExternalId(String),SProject.findBuildTypeById(String)
-
findBuildTypeById
@Nullable public BuildTypeImpl findBuildTypeById(@Nullable String internalId)
Description copied from interface:SProjectSearches for a build configuration in this and nested projects by the specified internal id.- Specified by:
findBuildTypeByIdin interfaceSProject- Parameters:
internalId- the internal id of the build configuration to look for; case sensitive.- Returns:
- the found build configuration or null.
- See Also:
SProject.findBuildTypeByExternalId(String)
-
findBuildTypeByExternalId
@Nullable public SBuildType findBuildTypeByExternalId(@Nullable String externalId)
Description copied from interface:SProjectSearches for a build configuration in this and nested projects by the specified external id.- Specified by:
findBuildTypeByExternalIdin interfaceSProject- Parameters:
externalId- the external id of the build configuration to look for; case insensitive.- Returns:
- the found build configuration or null.
- See Also:
SProject.findBuildTypeById(String)
-
removeBuildTypes
public void removeBuildTypes()
Unregisters all build types and templates.- Specified by:
removeBuildTypesin interfaceSProject
-
removeBuildTypeTemplate
@Deprecated public void removeBuildTypeTemplate(@NotNull String internalId) throws TemplateCannotBeRemovedException
Deprecated.Description copied from interface:SProjectRemoves build configuration template- Specified by:
removeBuildTypeTemplatein interfaceSProject- Parameters:
internalId- internal id of the template- Throws:
TemplateCannotBeRemovedException- if template cannot be deleted
-
removeBuildType
public void removeBuildType(@NotNull String internalId)Description copied from interface:SProjectRemoves build configuration with specified internal id- Specified by:
removeBuildTypein interfaceSProject- Parameters:
internalId- internal id of the build configuration
-
getId
@NotNull public EntityId<String> getId()
Description copied from interface:ProjectExReturns the project id.
-
getProjectId
@NotNull public String getProjectId()
Description copied from interface:BuildProjectReturns the internal project identifier.Before 8.0 TC there was only one project identifier. Since 8.0 there are two project identifiers: internal (with a surrogate value, to use in DB) and external (that is build based on the project name, or specified by users).
- Specified by:
getProjectIdin interfaceBuildProject- Returns:
- internal id.
- See Also:
BuildProject.getExternalId()
-
getConfigId
@NotNull public String getConfigId()
Description copied from interface:SPersistentEntityReturns the entity's config identifier. Config identifier uniquely identifies the entity across different TeamCity servers and can't be modified in contrast to external identifier.- Specified by:
getConfigIdin interfaceSPersistentEntity
-
getExternalId
@NotNull public String getExternalId()
Description copied from interface:BuildProjectReturns the external project identifier.- Specified by:
getExternalIdin interfaceBuildProject- Specified by:
getExternalIdin interfaceSPersistentEntity- Returns:
- external identifier.
- See Also:
BuildProject.getProjectId()
-
getParentProject
@Nullable public ProjectEx getParentProject()
Description copied from interface:SProjectReturns the parent of this project.Every project, except root, has a parent.
Note that sometimes during initialization the child project may already exist while the parent project does not exist yet. In this case for some time null could be returned for non-root projects.
- Specified by:
getParentProjectin interfaceBuildProject- Specified by:
getParentProjectin interfaceProjectEx- Specified by:
getParentProjectin interfaceSProject- Returns:
- the parent project, or null if this is a root.
- See Also:
BuildProject.getParentProjectId(),BuildProject.getParentProjectExternalId()
-
getParentProjectId
@Nullable public String getParentProjectId()
Description copied from interface:BuildProjectReturns internal id of the parent project of this project.Every project, except the root one, has a parent project.
- Specified by:
getParentProjectIdin interfaceBuildProject- Returns:
- parent project internal id or null if it is the root project
- See Also:
BuildProject.getParentProject(),BuildProject.getParentProjectExternalId()
-
getParent
@Nullable public SPersistentEntity getParent()
Description copied from interface:SPersistentEntityThe parent entity.- Specified by:
getParentin interfaceSPersistentEntity- Returns:
- see above.
-
getParentProjectExternalId
@Nullable public String getParentProjectExternalId()
Description copied from interface:BuildProjectReturns external id of the parent project of this project.Every project, except the root one, has a parent project.
- Specified by:
getParentProjectExternalIdin interfaceBuildProject- Returns:
- parent project external id or null if it is the root project
- See Also:
BuildProject.getParentProject(),BuildProject.getParentProjectId()
-
getProjectPath
@NotNull public List<SProject> getProjectPath()
Description copied from interface:SProjectThe tree path in project hierarchy from the root project to this one (in other words, all parents of this and this one).- Specified by:
getProjectPathin interfaceSProject- Returns:
- the tree path; the first node of this list is always the root project, the last node of this list is always this project.
-
clearProjectPathCache
public void clearProjectPathCache()
-
getOrganizationProject
@Nullable public SProject getOrganizationProject()
-
getOwnProjects
@NotNull public List<SProject> getOwnProjects()
Description copied from interface:SProjectReturns only own sub projects of this project.- Specified by:
getOwnProjectsin interfaceBuildProject- Specified by:
getOwnProjectsin interfaceSProject- Returns:
- list of projects sorted by name
-
getProjects
@NotNull public List<SProject> getProjects()
Description copied from interface:SProjectReturns all sub projects of this project transitively.- Specified by:
getProjectsin interfaceBuildProject- Specified by:
getProjectsin interfaceSProject- Returns:
- list of projects sorted by name
-
getName
@NotNull public String getName()
Description copied from interface:BuildProjectReturns project name- Specified by:
getNamein interfaceBuildProject- Specified by:
getNamein interfaceSPersistentEntity- Returns:
- presentable name
-
getFullName
@NotNull public String getFullName()
Description copied from interface:BuildProjectReturns project full name in the form: <parent project name> / <parent project name> / ... / <project name>. Root project name is not included in this sequence, so the first name in the sequence is the name of some child of the root project.- Specified by:
getFullNamein interfaceBuildProject- Returns:
- presentable name
-
setExternalId
public void setExternalId(@NotNull String newId) throws InvalidIdentifierException, DuplicateExternalIdExceptionDescription copied from interface:SProjectSets 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:
setExternalIdin interfaceSProject- Parameters:
newId- the new external project identifier.- Throws:
InvalidIdentifierExceptionDuplicateExternalIdException
-
setExternalId
public void setExternalId(@NotNull ConfigAction cause, @NotNull String newId) throws InvalidIdentifierException, DuplicateExternalIdExceptionDescription copied from interface:SProjectSets 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:
setExternalIdin interfaceSProjectnewId- the new external project identifier.- Throws:
InvalidIdentifierExceptionDuplicateExternalIdException
-
setExternalId
public void setExternalId(@NotNull ConfigAction cause, @NotNull String newId, boolean sendEvents) throws InvalidIdentifierException, DuplicateExternalIdException- Specified by:
setExternalIdin interfaceProjectEx- Throws:
InvalidIdentifierExceptionDuplicateExternalIdException
-
sendExtIdChangedEvents
public void sendExtIdChangedEvents(@NotNull ConfigAction cause, @NotNull String oldExternalId, @NotNull String newExternalId)- Specified by:
sendExtIdChangedEventsin interfaceProjectEx
-
isRootProject
public final boolean isRootProject()
Description copied from interface:BuildProjectReturns true iff this project is root project- Specified by:
isRootProjectin interfaceBuildProject- Returns:
- see above
-
moveToProject
public void moveToProject(@NotNull SProject target) throws CyclicDependencyException, InvalidVcsRootScopeExceptionDescription copied from interface:SProjectMoves this project to the target project.- Specified by:
moveToProjectin interfaceSProject- Parameters:
target- new parent project for this project- Throws:
CyclicDependencyExceptionInvalidVcsRootScopeException
-
moveToProject
public void moveToProject(@NotNull ConfigAction cause, @NotNull SProject target) throws CyclicDependencyException, InvalidVcsRootScopeExceptionDescription copied from interface:SProjectMoves this project to the target project.- Specified by:
moveToProjectin interfaceSProject- Parameters:
cause- config action caused the changetarget- new parent project for this project- Throws:
CyclicDependencyExceptionInvalidVcsRootScopeException
-
checkCyclicDependencies
public void checkCyclicDependencies(@NotNull SBuildType buildType)Description copied from interface:ProjectExChecks if a build type added or moved to the given project creates a cyclic snapshot dependency due to some dependencies defined in the project's effective default template- Specified by:
checkCyclicDependenciesin interfaceProjectEx
-
checkCyclicDependency
public void checkCyclicDependency(@NotNull Collection<SBuildType> buildTypes, @NotNull Dependency dependency)Description copied from interface:ProjectExChecks if a snapshot dependency creates a cycle if added to the provided build type.- Specified by:
checkCyclicDependencyin interfaceProjectEx- Parameters:
buildTypes- see abovedependency- see above
-
copyVcsRoot
@NotNull public SVcsRootEx copyVcsRoot(@NotNull SVcsRoot originalRoot, @Nullable String externalId)
Description copied from interface:SProjectCreates a copy of original VCS root in this project.- Specified by:
copyVcsRootin interfaceProjectEx- Specified by:
copyVcsRootin interfaceSProject- 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:SProjectCreates new VCS root in this project- Specified by:
createVcsRootin interfaceProjectEx- Specified by:
createVcsRootin interfaceSProject- 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:SProjectCreates new VCS root in this project- Specified by:
createVcsRootin interfaceSProject- 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
-
createDummyVcsRoot
@NotNull public SVcsRoot createDummyVcsRoot(@NotNull String vcsName, @NotNull Map<String,String> parameters)
Description copied from interface:SProjectCreates a dummy VCS root which cannot be persisted, but can be used in cases when project specific VCS operation must be performed.- Specified by:
createDummyVcsRootin interfaceSProject- Parameters:
vcsName- name of VCS pluginparameters- VCS root properties- Returns:
- see above
-
setName
public void setName(@NotNull String name)Description copied from interface:SProjectRenames project
-
setDescription
public void setDescription(@Nullable String description)Description copied from interface:SProjectSets this project description- Specified by:
setDescriptionin interfaceSProject- Parameters:
description- new project description
-
getDescription
@NotNull public String getDescription()
Description copied from interface:BuildProjectReturns project description- Specified by:
getDescriptionin interfaceBuildProject- Returns:
- project description
-
getOwnBuildTypes
@NotNull public List<SBuildType> getOwnBuildTypes()
Description copied from interface:SProjectReturns all build configurations registered in this certain project. Does NOT include build configurations from subprojects.- Specified by:
getOwnBuildTypesin interfaceBuildProject- Specified by:
getOwnBuildTypesin interfaceSProject- Returns:
- list of build configurations sorted by name
-
getBuildTypes
@NotNull public List<SBuildType> getBuildTypes()
Description copied from interface:SProjectReturns all build configurations registered in this project and all its subprojects (not only direct subprojects, but all).- Specified by:
getBuildTypesin interfaceBuildProject- Specified by:
getBuildTypesin interfaceSProject- Returns:
- list of build configurations sorted by name
-
getOwnVcsRoots
@NotNull public List<SVcsRoot> getOwnVcsRoots()
Description copied from interface:SProjectReturns VCS roots associated with this certain project. Does NOT include VCS roots from subprojects.- Specified by:
getOwnVcsRootsin interfaceBuildProject- Specified by:
getOwnVcsRootsin interfaceSProject- Returns:
- list of VCS roots sorted by VCS root name
-
findVcsRootByName
@Nullable public SVcsRoot findVcsRootByName(@NotNull String name)
Description copied from interface:SProjectReturns own VCS root with given name or null if project does not have such VCS root- Specified by:
findVcsRootByNamein interfaceSProject- Parameters:
name- name of VCS root- Returns:
- found VCS root or null
-
getVcsRoots
@NotNull public List<SVcsRoot> getVcsRoots()
Description copied from interface:SProjectReturns all VCS roots associated with this project and all its subprojects transitively.- Specified by:
getVcsRootsin interfaceBuildProject- Specified by:
getVcsRootsin interfaceSProject- Returns:
- list of vcs roots
-
getUsedVcsRoots
@NotNull public List<SVcsRoot> getUsedVcsRoots()
- Specified by:
getUsedVcsRootsin interfaceSProject- Returns:
- all VCS roots used in this project and subprojects (attached to build types or templates)
-
getVcsRootInstances
@NotNull public List<VcsRootInstance> getVcsRootInstances()
- Specified by:
getVcsRootInstancesin interfaceSProject- Returns:
- all VCS root instances used in the project and subprojects.
-
hasBuildTypes
public boolean hasBuildTypes()
Description copied from interface:SProjectReturns true if this project contains at least one own build configuration- Specified by:
hasBuildTypesin interfaceSProject- Returns:
- true if this project has it's own build configurations
-
persist
public void persist()
Description copied from interface:SProjectPersists this project configuration on disk.- Specified by:
persistin interfaceSPersistentEntity- Specified by:
persistin interfaceSProject
-
persist
public void persist(@NotNull ConfigAction cause) throws PersistFailedExceptionDescription copied from interface:SPersistentEntityPersists this entity on disk.- Specified by:
persistin interfaceSPersistentEntity- Parameters:
cause- an action which caused persisting- Throws:
PersistFailedException- if persisting failed
-
schedulePersisting
@NotNull public BackgroundPersistTask schedulePersisting(@NotNull ConfigAction cause) throws PersistFailedException
Description copied from interface:SPersistentEntitySchedules background persisting of this project settings.- Specified by:
schedulePersistingin interfaceSPersistentEntity- Parameters:
cause- an action which caused persisting- Returns:
- a task which can be used to track the operation progress or wait for the operation to complete
- Throws:
PersistFailedException- if failed to schedule the operation- See Also:
SPersistentEntity.schedulePersisting(String)
-
scheduleFileSave
@NotNull public PersistTask scheduleFileSave(@NotNull ConfigAction cause, @NotNull String pathInProjectDir, @NotNull byte[] fileContent) throws PersistFailedException
- Specified by:
scheduleFileSavein interfaceProjectEx- Throws:
PersistFailedException
-
scheduleFileDelete
@NotNull public PersistTask scheduleFileDelete(@NotNull ConfigAction cause, @NotNull String pathInProjectDir)
- Specified by:
scheduleFileDeletein interfaceProjectEx
-
schedulePersisting
@NotNull public BackgroundPersistTask schedulePersisting(@NotNull String reason) throws PersistFailedException
Description copied from interface:SPersistentEntitySchedules background persisting of this entity settings.- Specified by:
schedulePersistingin interfaceSPersistentEntity- Parameters:
reason- provides a reason why persist operation was called- Returns:
- a task which can be used to track the operation progress or wait for the operation to complete
- Throws:
PersistFailedException- if failed to schedule the operation- See Also:
SPersistentEntity.schedulePersisting(ConfigAction)
-
getLastConfigModificationAction
@Nullable public AuditLogAction getLastConfigModificationAction()
- Specified by:
getLastConfigModificationActionin interfaceProjectEx
-
isArchived
public boolean isArchived()
Description copied from interface:SProjectReturns true if the project is archived- Specified by:
isArchivedin interfaceSProject- Returns:
- true if the project is archived
-
setArchived
public void setArchived(boolean archived, @Nullable User user)Description copied from interface:SProjectSets project's and sub project's archived flags, pauses build configurations. Persists configuration changes on disk.- Specified by:
setArchivedin interfaceSProject- Parameters:
archived- is the project archiveduser- the user the performs the action
-
getArchivingUser
@Nullable public User getArchivingUser()
Description copied from interface:SProjectReturns the user who archived the project. Returns null, if project is active, or the action author is unknown.- Specified by:
getArchivingUserin interfaceSProject- Returns:
- user who archived the project
-
getArchivingTime
@Nullable public Date getArchivingTime()
Description copied from interface:SProjectReturns the date when the project was archived. Returns null, if project is active, or the action author is unknown.- Specified by:
getArchivingTimein interfaceSProject- Returns:
- archiving time
-
getExtendedName
@NotNull public String getExtendedName()
Description copied from interface:SProjectReturns the name of the project with additional note if the project is archived, i.e. " (archived)" suffix. Useful when archived projects should be shown together with non-archived.- Specified by:
getExtendedNamein interfaceSProject- Returns:
- extended project name
- See Also:
BuildProject.getName()
-
getExtendedFullName
@NotNull public String getExtendedFullName()
Description copied from interface:SProjectReturns the full name of the project with additional note if the project is archived, i.e. " (archived)" suffix. Useful when archived projects should be shown together with non-archived.- Specified by:
getExtendedFullNamein interfaceSProject- Returns:
- extended full project name
- See Also:
BuildProject.getFullName()
-
getOwnBuildTypeTemplates
@NotNull public List<BuildTypeTemplate> getOwnBuildTypeTemplates()
Description copied from interface:SProjectReturns build configuration templates registered in this certain project. Does NOT include build configuration templates from subprojects.- Specified by:
getOwnBuildTypeTemplatesin interfaceSProject- Returns:
- list of build configuration templates sorted by name
-
getBuildTypeTemplates
@NotNull public List<BuildTypeTemplate> getBuildTypeTemplates()
Description copied from interface:SProjectReturns all build configuration templates registered in this project and all its subprojects (not only direct).- Specified by:
getBuildTypeTemplatesin interfaceSProject- Returns:
- list of build configuration templates sorted by name
-
getAvailableTemplates
@NotNull public List<BuildTypeTemplate> getAvailableTemplates()
- Specified by:
getAvailableTemplatesin interfaceSProject- Returns:
- list of templates available in this project, i.e. all templates of this project and all templates from parents.
-
getAvailableVcsRoots
@NotNull public List<SVcsRoot> getAvailableVcsRoots()
- Specified by:
getAvailableVcsRootsin interfaceSProject- Returns:
- list of VCS roots available in this project, i.e. all VCS roots of this project and all VCS roots from parents.
-
findBuildTypeTemplateById
@Nullable public BuildTypeTemplate findBuildTypeTemplateById(@NotNull String intId)
Description copied from interface:SProjectSearches for build type template by given internal id in this and nested projects.- Specified by:
findBuildTypeTemplateByIdin interfaceSProject- Parameters:
intId- internal id of template to look for.- Returns:
- found template or null.
- See Also:
SProject.findBuildTypeTemplateByExternalId(java.lang.String)
-
findBuildTypeTemplateByExternalId
@Nullable public BuildTypeTemplate findBuildTypeTemplateByExternalId(@NotNull String extId)
Description copied from interface:SProjectSearches for build type template by given external id in this and nested project.- Specified by:
findBuildTypeTemplateByExternalIdin interfaceSProject- Parameters:
extId- external id of template to look for.- Returns:
- found template or null.
- See Also:
SProject.findBuildTypeTemplateById(java.lang.String)
-
findBuildTypeTemplateByName
@Nullable public BuildTypeTemplate findBuildTypeTemplateByName(@NotNull String name)
Description copied from interface:SProjectSearches for a template with specified name in this project (not in subprojects).- Specified by:
findBuildTypeTemplateByNamein interfaceSProject- Parameters:
name- name of the template.- Returns:
- see above
- See Also:
SProject.findBuildTypeTemplateByExternalId(java.lang.String),SProject.findBuildTypeTemplateById(java.lang.String)
-
addParameter
public void addParameter(@NotNull Parameter param)Description copied from interface:UserParametersHolderAdds parameter.- Specified by:
addParameterin interfaceUserParametersHolder- Parameters:
param- build or config parameter, the type is determined by parameter prefix
-
removeParameter
public void removeParameter(@NotNull String paramName)Description copied from interface:UserParametersHolderRemoves parameter.- Specified by:
removeParameterin interfaceUserParametersHolder- Parameters:
paramName- build or config parameter name, the type is determined by parameter prefix
-
getParametersCollection
@NotNull public Collection<Parameter> getParametersCollection()
Description copied from interface:ReadOnlyUserParametersReturns build and configuration parameters in single collection.- Specified by:
getParametersCollectionin interfaceInheritableUserParametersHolder- Specified by:
getParametersCollectionin interfaceReadOnlyUserParameters- Returns:
- merged collection of parameters, i.e. all parameters inherited from parent holders and own parameters
-
getParameter
@Nullable public Parameter getParameter(@NotNull String paramName)
- Specified by:
getParameterin interfaceReadOnlyUserParameters
-
getParameters
@NotNull public Map<String,String> getParameters()
Description copied from interface:ReadOnlyUserParametersReturns map of build and configuration parameters.- Specified by:
getParametersin interfaceInheritableUserParametersHolder- Specified by:
getParametersin interfaceReadOnlyUserParameters- Returns:
- merged map of parameters, i.e. all parameters inherited from parent holders and own parameters
-
getParameterValue
@Nullable public String getParameterValue(@NotNull String paramName)
- Specified by:
getParameterValuein interfaceReadOnlyUserParameters- Parameters:
paramName- parameter name- Returns:
- value of the parameter with given name or null if there is no such parameter
-
getOwnParametersCollection
@NotNull public Collection<Parameter> getOwnParametersCollection()
- Specified by:
getOwnParametersCollectionin interfaceInheritableUserParametersHolder- Returns:
- own parameters, without inherited. Yet they would have inherited specs or values (if any).
-
getOwnSerializableParameters
@NotNull public SerializableParametersCollection getOwnSerializableParameters()
- Specified by:
getOwnSerializableParametersin interfaceProjectEx
-
replaceInValues
public boolean replaceInValues(@NotNull Pattern regexp, @NotNull String replacement)Description copied from interface:ProjectExProcesses project settings and replaces all values matched by regexp to specified replacement string. Currently works for parameters only.- Specified by:
replaceInValuesin interfaceProjectEx- Returns:
-
getOwnParameters
@NotNull public Map<String,String> getOwnParameters()
- Specified by:
getOwnParametersin interfaceInheritableUserParametersHolder- Returns:
- own parameters map, without inherited. Yet they would have inherited specs or values (if any).
-
getStatus
@NotNull public Status getStatus()
Description copied from interface:BuildProjectReturns project status calculated according to cumulative status of all build configurations registered in the project. Since 8.0.3: if the project is active (not archived), the status of the archived subprojects is ignored.- Specified by:
getStatusin interfaceBuildProject- Returns:
- current project status
-
getConfigDirectory
@NotNull public File getConfigDirectory()
Description copied from interface:SProjectReturns this project configuration directory, i.e. a directory where this project configuration is stored.- Specified by:
getConfigDirectoryin interfaceSProject- Returns:
- this project configuration directory
-
getArtifactsDirectory
@NotNull public File getArtifactsDirectory()
Description copied from interface:SProjectReturns directory containing all of the project artifacts.- Specified by:
getArtifactsDirectoryin interfaceSProject- Returns:
- directory containing all of the project artifacts.
-
getPluginDataDirectory
@NotNull public File getPluginDataDirectory(@NotNull String pluginName)
Description copied from interface:SProjectReturns plugin data directory for given plugin name- Specified by:
getPluginDataDirectoryin interfaceSProject- Returns:
- directory containing some plugin data.
-
compareTo
public int compareTo(@NotNull BuildProject o)- Specified by:
compareToin interfaceComparable<BuildProject>
-
attachedToModel
public void attachedToModel(@NotNull ProjectDataModel model)- Specified by:
attachedToModelin interfaceProjectEx
-
remove
public void remove()
Description copied from interface:SPersistentEntityRemoves this entity.This method also makes all changes (related to removing the entity) on the disk and in the database. There is no need to call the persist() after this method.
- Specified by:
removein interfaceSPersistentEntity
-
scheduleRemove
@NotNull public PersistTask scheduleRemove(@NotNull ConfigAction cause)
Description copied from interface:SPersistentEntitySchedules remove of this persistent entity. Returns task which can be used to wait for the operation to complete.- Specified by:
scheduleRemovein interfaceSPersistentEntity- Parameters:
cause- reason of the remove- Returns:
- a task which can be used to track the operation progress or wait for the operation to complete
-
dispose
public void dispose()
Description copied from interface:ProjectExMust be called when this project object is removed from the model.
-
unregister
public void unregister()
Description copied from interface:ProjectExTries to unregister this project from the model. Will firstly detach default&enforced templates then under synchronized block on ProjectManager instance will check that this project doesn't contain any subprojects and will remove this project from the model. If project has subprojects then ProjectRemoveFailedException will be thrown and default&enforced templates will be restored. Synchronization is needed to ensure no subprojects will be added during remove procedure.- Specified by:
unregisterin interfaceProjectEx
-
getProjectDataModel
@NotNull public ProjectDataModel getProjectDataModel()
- Specified by:
getProjectDataModelin interfaceProjectEx
-
getCommitters
@NotNull public List<SUser> getCommitters(int periodInSeconds)
Description copied from interface:ProjectExReturns committers to this project for the specified period (in seconds).- Specified by:
getCommittersin interfaceProjectEx- Parameters:
periodInSeconds- period in seconds- Returns:
- all users who committed to this project for the specified period, sorted by their names
-
resortBuildTypes
public void resortBuildTypes()
Description copied from interface:ProjectExResorts build configurations contained- Specified by:
resortBuildTypesin interfaceProjectEx
-
addBuildTypeTemplate
public void addBuildTypeTemplate(@NotNull BuildTypeTemplateEx template) throws DuplicateTemplateNameExceptionDescription copied from interface:ProjectExStores build type template in the project, should be used when templates are loaded from configuration files.- Specified by:
addBuildTypeTemplatein interfaceProjectEx- Parameters:
template- template- Throws:
DuplicateTemplateNameException- if template with same name already exists in the project
-
getDefaultTemplateId
@Nullable public String getDefaultTemplateId()
Description copied from interface:SProjectReturns an internal id of a default template effective in the project- Specified by:
getDefaultTemplateIdin interfaceSProject- Returns:
- see above, null if no default template is found
-
getOwnDefaultTemplateId
@Nullable public String getOwnDefaultTemplateId()
Description copied from interface:SProjectReturns an internal id of a default template defined in the project- Specified by:
getOwnDefaultTemplateIdin interfaceSProject- Returns:
- see above, null if no default template is found
-
getOwnDefaultTemplateExternalId
public String getOwnDefaultTemplateExternalId()
- Specified by:
getOwnDefaultTemplateExternalIdin interfaceProjectEx
-
getDefaultTemplate
@Nullable public BuildTypeTemplateEx getDefaultTemplate()
Description copied from interface:SProjectReturns a default template effective in the project- Specified by:
getDefaultTemplatein interfaceSProject- Returns:
- see above, null if no default template is found
-
getOwnDefaultTemplate
@Nullable public BuildTypeTemplateEx getOwnDefaultTemplate()
Description copied from interface:SProjectReturns a default template defined in the project- Specified by:
getOwnDefaultTemplatein interfaceSProject- Returns:
- see above, null if no default template is found
-
setDefaultTemplate
public void setDefaultTemplate(@Nullable BuildTypeTemplate template)- Specified by:
setDefaultTemplatein interfaceProjectEx
-
addDefaultTemplateListener
public void addDefaultTemplateListener()
- Specified by:
addDefaultTemplateListenerin interfaceProjectEx
-
removeDefaultTemplateListener
public void removeDefaultTemplateListener()
- Specified by:
removeDefaultTemplateListenerin interfaceProjectEx
-
clearDefaultTemplateIdCacheForSelfAndChildren
public void clearDefaultTemplateIdCacheForSelfAndChildren()
-
getMulticaster
protected BuildServerListener getMulticaster()
-
getParametersProvider
@NotNull public ParametersProvider getParametersProvider()
Description copied from interface:ParametersSupportReturns parameters which can be used by value resolver. Note that some of the parameters may not have values defined because sometimes values can be calculated on the agent side only.- Specified by:
getParametersProviderin interfaceParametersSupport- Returns:
- parameters
-
getValueResolver
@NotNull public ValueResolver getValueResolver()
Description copied from interface:ParametersSupportReturns value resolver which can be used to resolve references in values- Specified by:
getValueResolverin interfaceParametersSupport- Returns:
- value resolver
-
describe
@NotNull public String describe(boolean verbose)
-
belongsTo
public boolean belongsTo(@NotNull SProject project)Description copied from interface:SProjectReturns true if the specified project is or contains (including transitively) this project.
-
getCleanupPolicies
@NotNull public Collection<HistoryRetentionPolicy> getCleanupPolicies()
- Specified by:
getCleanupPoliciesin interfaceCleanupSettings- Returns:
- combined cleanup policies, including those inherited from default or parent object
-
getOwnCleanupPolicies
@NotNull public Collection<HistoryRetentionPolicy> getOwnCleanupPolicies()
- Specified by:
getOwnCleanupPoliciesin interfaceCleanupSettings- Returns:
- cleanup policies, specific for this object only
-
getInheritedCleanupPolicies
@NotNull public Collection<HistoryRetentionPolicy> getInheritedCleanupPolicies()
- Specified by:
getInheritedCleanupPoliciesin interfaceCleanupSettings
-
getInheritedCleanupOptions
@NotNull public Map<String,Boolean> getInheritedCleanupOptions()
- Specified by:
getInheritedCleanupOptionsin interfaceCleanupSettings
-
getCleanupOptions
@NotNull public Map<String,Boolean> getCleanupOptions()
- Specified by:
getCleanupOptionsin interfaceCleanupSettings- Returns:
- map of all cleanup options
-
getOwnCleanupOptions
@NotNull public Map<String,Boolean> getOwnCleanupOptions()
- Specified by:
getOwnCleanupOptionsin interfaceCleanupSettings- Returns:
- map of own cleanup options only
-
getOwnCleanupSettingsSupport
@NotNull public CleanupSettingsSupport getOwnCleanupSettingsSupport()
- Specified by:
getOwnCleanupSettingsSupportin interfaceProjectEx
-
addCleanupPolicy
public void addCleanupPolicy(@NotNull HistoryRetentionPolicy policy)Description copied from interface:CleanupSettingsInitSets cleanup policy for this build configuration- Specified by:
addCleanupPolicyin interfaceCleanupSettingsInit- Parameters:
policy- policy to set
-
removeCleanupPolicies
public void removeCleanupPolicies()
Description copied from interface:CleanupSettingsInitRemove all own cleanup policies for the object- Specified by:
removeCleanupPoliciesin interfaceCleanupSettingsInit
-
setCleanupOption
public void setCleanupOption(@NotNull String option, @Nullable Boolean value)Description copied from interface:CleanupSettingsInitSets value for a cleanup option- Specified by:
setCleanupOptionin interfaceCleanupSettingsInit- Parameters:
option- cleanup option (seeCleanupSettingsconstants)value- value to set option to, ornullto remove the option
-
setOwnProjectsOrder
public void setOwnProjectsOrder(List<String> internalIds)
- Specified by:
setOwnProjectsOrderin interfaceProjectEx- Parameters:
internalIds- Empty list will remove custom ordering
-
setOwnBuildTypesOrder
public void setOwnBuildTypesOrder(List<String> internalIds)
- Specified by:
setOwnBuildTypesOrderin interfaceProjectEx- Parameters:
internalIds- Empty list will remove custom ordering
-
getOwnProjectsOrder
@NotNull public List<SProject> getOwnProjectsOrder()
Description copied from interface:ProjectExUnlike SProject.getOwnProjects() could return partial list of Projects (if custom ordering is partial)- Specified by:
getOwnProjectsOrderin interfaceProjectEx- Returns:
- List of Project ordered
-
getOwnBuildTypesOrder
@NotNull public List<SBuildType> getOwnBuildTypesOrder()
Description copied from interface:ProjectExUnlike SProject.getOwnBuildTypes() could return partial list of Build Types (if custom ordering is partial)- Specified by:
getOwnBuildTypesOrderin interfaceProjectEx- Returns:
- List of Build Types ordered
-
getArtifactDirectories
@NotNull public List<File> getArtifactDirectories()
- Specified by:
getArtifactDirectoriesin interfaceProjectEx- Returns:
- list of directories where artifacts of builds of this project are stored. List always has at least one element. The first directory in the list is a directory where new builds store their artifacts.
-
setEditable
public void setEditable(boolean editable)
Description copied from interface:ProjectExEnables 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:
setEditablein interfaceProjectEx- Parameters:
editable- true to enable editing and false to disable
-
getOwnEnforcedSettings
@Nullable public ProjectEnforcedSettings getOwnEnforcedSettings()
- Specified by:
getOwnEnforcedSettingsin interfaceProjectEx- Returns:
- enforced settings profile attached to this project. Should not be used for validation - use
ProjectEx.getEnforcedSettings()instead
-
getEnforcedSettings
@NotNull public EnforcedSettings getEnforcedSettings()
- Specified by:
getEnforcedSettingsin interfaceProjectEx- Returns:
- enforced settings affecting on this project - its own and all its parent`s (if any). Should not be used to update enforces settings - use
ProjectEx.getOwnEnforcedSettings()instead
-
setEnforcedSettings
public void setEnforcedSettings(@Nullable ProjectEnforcedSettings enforcedSettings)Description copied from interface:ProjectExAttach 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:
setEnforcedSettingsin interfaceProjectEx
-
attachEnforcedSettings
public void attachEnforcedSettings(@NotNull BuildTypeTemplate typeTemplateEx)- Specified by:
attachEnforcedSettingsin interfaceProjectEx
-
getNextAvailableFeatureId
@Nullable public String getNextAvailableFeatureId(@NotNull String type, @NotNull Map<String,String> params)
Description copied from interface:ProjectExReturns a generated ID that will be used by the next feature added to this project- Specified by:
getNextAvailableFeatureIdin interfaceProjectEx- Parameters:
type- - type of the featureparams- - optional parameters used for generating IDs for specific types of features- Returns:
- next available ID
-
addFeature
@NotNull public SProjectFeatureDescriptor addFeature(@NotNull String type, @NotNull Map<String,String> params)
Description copied from interface:SProjectAdds new project feature.- Specified by:
addFeaturein interfaceSProject- 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:SProjectAdds new project feature with provided ID if auto-generated ID is not desirable- Specified by:
addFeaturein interfaceSProject- 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:SProjectAdds project feature. If the project feature doesn't belong to this project - a copy will be created.- Specified by:
addFeaturein interfaceSProject- Parameters:
feature- project feature to add
-
getOwnFeatures
@NotNull public Collection<SProjectFeatureDescriptor> getOwnFeatures()
- Specified by:
getOwnFeaturesin interfaceSProject- Returns:
- own project features.
-
getOwnFeaturesOfType
@NotNull public Collection<SProjectFeatureDescriptor> getOwnFeaturesOfType(@NotNull String type)
- Specified by:
getOwnFeaturesOfTypein interfaceSProject- Parameters:
type- type of project feature- Returns:
- own project features of specified type.
-
getAvailableFeaturesOfType
@NotNull public Collection<SProjectFeatureDescriptor> getAvailableFeaturesOfType(@NotNull String type)
- Specified by:
getAvailableFeaturesOfTypein interfaceSProject- Parameters:
type- type of project feature- Returns:
- project features of this project and all its ancestors. Own features come first, Root project`s last.
-
getAvailableFeatures
@NotNull public Collection<SProjectFeatureDescriptor> getAvailableFeatures()
- Specified by:
getAvailableFeaturesin interfaceSProject- Returns:
- project all features of this project and all its ancestors. Own features come first, Root project`s last.
-
removeFeature
@Nullable public SProjectFeatureDescriptor removeFeature(@NotNull String featureId)
Description copied from interface:SProjectRemoves project feature with specified id.- Specified by:
removeFeaturein interfaceSProject- 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:SProjectUpdates type and parameters of project feature with specified id.- Specified by:
updateFeaturein interfaceSProject- Parameters:
featureId- feature idnewType- new feature typenewParams- new feature parameters- Returns:
- true if feature with specified id was found and updated
-
findFeatureById
@Nullable public SProjectFeatureDescriptor findFeatureById(@NotNull String featureId)
Description copied from interface:SProjectFinds project feature by id.- Specified by:
findFeatureByIdin interfaceSProject- Parameters:
featureId- feature id- Returns:
- found feature or null
-
isReadOnly
public boolean isReadOnly()
- Specified by:
isReadOnlyin interfaceSPersistentEntity- Returns:
- true if this entity settings are in read only mode
-
getReadOnlyReason
@Nullable public ReadOnlyReason getReadOnlyReason()
- Specified by:
getReadOnlyReasonin interfaceSPersistentEntity- Returns:
- reason why this entity settings are in read only state or null if they are not read only
-
resetCachedReadOnlyReason
protected void resetCachedReadOnlyReason(boolean resetInSubProjects)
-
isVirtual
public boolean isVirtual()
Description copied from interface:SProjectReturns true for so-called virtual projects. Virtual projects most likely are created automatically and exist for auxiliary purposes. They can disappear or can be recreated at any point of time. If the project is marked as "virtual", then it is not shown in the lists of projects and is only accessible by direct URL. User data, such as mutes and investigations, should not be assigned with such projects.- Specified by:
isVirtualin interfaceSPersistentEntity- Specified by:
isVirtualin interfaceSProject- Returns:
- true if the project is virtual and false otherwise.
-
getAgentPools
public List<AgentPool> getAgentPools()
Description copied from interface:SProjectReturn list of Agent Pool this project is associated with.- Specified by:
getAgentPoolsin interfaceSProject- Returns:
- see above
-
getEditableSettingsNote
@Nullable public String getEditableSettingsNote()
Description copied from interface:ProjectExReturns admin area header note text to be shown if this project is editable or null if no note should be shown- Specified by:
getEditableSettingsNotein interfaceProjectEx
-
hasVersionedSettings
public boolean hasVersionedSettings()
Description copied from interface:ProjectExReturns true if this project stores its settings in VCS, false otherwise- Specified by:
hasVersionedSettingsin interfaceProjectEx- Returns:
- see above
-
isExtIdChangeSupported
public boolean isExtIdChangeSupported()
Description copied from interface:ProjectExReturns true if extId can be changed in this project and all its entities- Specified by:
isExtIdChangeSupportedin interfaceProjectEx- Returns:
- see above
-
isMoveEntitiesSupported
public boolean isMoveEntitiesSupported()
Description copied from interface:ProjectExReturns true if project settings format supports move of entities in projects hierarchy- Specified by:
isMoveEntitiesSupportedin interfaceProjectEx- Returns:
- see above
-
isMoveSupported
public boolean isMoveSupported()
Description copied from interface:ProjectExReturns true if project settings format supports move of the project with all its entities in projects hierarchy- Specified by:
isMoveSupportedin interfaceProjectEx- Returns:
- see above
-
isProjectCreateSupported
public boolean isProjectCreateSupported()
Description copied from interface:ProjectExReturns true if format supports new project creation- Specified by:
isProjectCreateSupportedin interfaceProjectEx- Returns:
- see above
-
isProjectDeleteSupported
public boolean isProjectDeleteSupported()
Description copied from interface:ProjectExReturns true if project settings format supports delete of the project- Specified by:
isProjectDeleteSupportedin interfaceProjectEx- Returns:
- see above
-
isDefaultBranchExcluded
public boolean isDefaultBranchExcluded()
Description copied from interface:ProjectExReturns true if all project's own buildTypes exclude the default branch. Returns false if project doesn't have own buildTypes.- Specified by:
isDefaultBranchExcludedin interfaceProjectEx- Returns:
- see above
-
getOwnParameter
public Parameter getOwnParameter(@NotNull String paramName)
- Specified by:
getOwnParameterin interfaceInheritableUserParametersHolder- Parameters:
paramName- parameter name- Returns:
- own parameter with given name or null if there is no such parameter
-
getOwnAndParentsNonInheritedParameters
@NotNull public List<Collection<Parameter>> getOwnAndParentsNonInheritedParameters()
Description copied from interface:InheritableUserParametersHolderExOwn should be last. Root should be first. Should not contain nulls or empty collections.
- Specified by:
getOwnAndParentsNonInheritedParametersin interfaceInheritableUserParametersHolderEx- Returns:
-
getOwnAndParentsNonInheritedParameter
@NotNull public List<Parameter> getOwnAndParentsNonInheritedParameter(@NotNull String paramName)
Description copied from interface:InheritableUserParametersHolderExOwn should be last. Root should be first. Should not contain nulls.
- Specified by:
getOwnAndParentsNonInheritedParameterin interfaceInheritableUserParametersHolderEx- Returns:
-
getOwnParametersWithoutInheritedSpec
@NotNull public Collection<Parameter> getOwnParametersWithoutInheritedSpec()
- Specified by:
getOwnParametersWithoutInheritedSpecin interfaceInheritableUserParametersHolder- Returns:
- own parameters as is, with own parameters spec.
-
getInheritedParametersCollection
@NotNull public Collection<Parameter> getInheritedParametersCollection()
- Specified by:
getInheritedParametersCollectionin interfaceInheritableUserParametersHolder- Returns:
- collection of inherited parameters.
-
getOwnNonInheritedParameter
@Nullable public Parameter getOwnNonInheritedParameter(@NotNull String paramName)
Description copied from interface:InheritableUserParametersHolderExOwn parameter without inherited parameter spec.- Specified by:
getOwnNonInheritedParameterin interfaceInheritableUserParametersHolderEx- Returns:
-
getOrCreateToken
@NotNull public String getOrCreateToken(@NotNull String secret, @NotNull String contextDescription)
Description copied from interface:SecureTokensProducerFor 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:
getOrCreateTokenin interfaceSecureTokensProducer- 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
-
getTokenContext
@Nullable public String getTokenContext(@NotNull String token)
- Specified by:
getTokenContextin interfaceProjectEx- Returns:
- context in which it was requested first. Used for displaying it to user so they could better work with it
-
getSecureValue
@NotNull public String getSecureValue(@NotNull String token, @NotNull String contextDescription)
Description copied from interface:SecureDataStorageReturns a secret (password, API key, etc) associated with this project and token, or the same token if there is no such secret. In the latter case a health report will be raised for project administrators.- Specified by:
getSecureValuein interfaceSecureDataStorage- Parameters:
token- tokencontextDescription- 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:
- see above
-
getTokensWithoutSecret
@NotNull public Map<String,String> getTokensWithoutSecret()
- Specified by:
getTokensWithoutSecretin interfaceProjectEx- Returns:
- map of tokens which were accessed at some point, but no secrets were found for them; key in returned map is token, and value is human friendly description of the context in which token was used.
-
getCredentialsStorageType
@Nullable public String getCredentialsStorageType()
- Specified by:
getCredentialsStorageTypein interfaceProjectEx- Returns:
- name of currently used credentials storage, or null if project does not use any storage
-
getCredentialsStorage
@Nullable public CredentialsStorage getCredentialsStorage()
- Specified by:
getCredentialsStoragein interfaceProjectEx- Returns:
- currently used credentials storage, or null of project does not use any storage
-
getVersionedSettingsVcsRoot
@Nullable public SVcsRoot getVersionedSettingsVcsRoot()
Description copied from interface:ProjectEx- Specified by:
getVersionedSettingsVcsRootin interfaceProjectEx
-
getEffectiveGenerator
@Nullable public ProjectSettingsGenerator getEffectiveGenerator()
Description copied from interface:ProjectExSame asVersionedSettingsManager.getEffectiveGenerator(SProject), but returns null if generator is not found instead of throwing an error- Specified by:
getEffectiveGeneratorin interfaceProjectEx
-
hasSettingsWithSecureValues
public boolean hasSettingsWithSecureValues()
- Specified by:
hasSettingsWithSecureValuesin interfaceProjectEx- Returns:
- true if this project or its sub projects have secure values (passwords) in their settings:
- parameters of password type
- VCS roots with not empty passwords
- any other settings with not empty passwords
-
getVersion
@NotNull public PersistentEntityVersion getVersion()
Description copied from interface:SPersistentEntityReturns version of this entity which can be used to check if the entity was edited or persisted.- Specified by:
getVersionin interfaceSPersistentEntity- Returns:
- see above
-
markPersisted
public void markPersisted(long expectedEditId)
Description copied from interface:SPersistentEntityMarks entity as persisted- Specified by:
markPersistedin interfaceSPersistentEntity- Parameters:
expectedEditId- expected editId in the end of persist. The entity will be marked as unedited if expected editId is the same as actual, ie. the entity wasn't edited while persist was running
-
getCustomDataStorage
@NotNull public CustomDataStorage getCustomDataStorage(@NotNull String storageId)
Description copied from interface:SProjectReturns a custom data storage for the given storage id associated with this project- Specified by:
getCustomDataStoragein interfaceSProject- Parameters:
storageId- storage id of interest- Returns:
- see above
-
saveSettingsBranchSpec
public boolean saveSettingsBranchSpec(@NotNull VcsRootInstance root, @NotNull BranchSpec spec)Description copied from interface:ProjectExUpdates versioned settings root and branch spec last used for changes collecting. Returns true if either VCS root or branch spec was changed comparing to their previous values- Specified by:
saveSettingsBranchSpecin interfaceProjectEx- Parameters:
root- settings root instancespec- branch spec used for changes collecting- Returns:
- see above
-
getSettingsRootSpec
@Nullable public Pair<VcsRootInstance,BranchSpec> getSettingsRootSpec()
Description copied from interface:ProjectExReturns last used versioned settings VCS root and its branch spec or null if this information is not found project's custom data storage- Specified by:
getSettingsRootSpecin interfaceProjectEx- Returns:
- see above
-
findPluginSettings
@Nullable public File findPluginSettings(@NotNull String pluginName, @NotNull String fileNme)
Description copied from interface:ProjectExSearch for a plugin settings file for given project. The method is looking for the file in plugin data directory for given plugin name and its parents, starting from the specified project- Specified by:
findPluginSettingsin interfaceProjectEx- Parameters:
pluginName- the name of the pluginfileNme- settings file name to search- Returns:
- settings file if found,
nullotherwise
-
isEmptyUuid
public boolean isEmptyUuid()
- Specified by:
isEmptyUuidin interfaceProjectEx- Returns:
- true if this project has an empty uuid in its config on disk
-
initArchivedStatus
public void initArchivedStatus(boolean archived)
Description copied from interface:ProjectExInitializes project's archived flag. Should be used only when creating a project.- Specified by:
initArchivedStatusin interfaceProjectEx- Parameters:
archived- archived flag
-
getParametersSupport
@NotNull public ContainerWithInherited<String,Parameter> getParametersSupport()
- Specified by:
getParametersSupportin interfaceParameterSupport- Specified by:
getParametersSupportin interfaceProjectEx
-
createConfigAction
@NotNull public ConfigActionEx createConfigAction(@Nullable SUser user, @NotNull String description)
Description copied from interface:SPersistentEntityCreates a config action instance associated with this entity and having the specified description. The config action object can be used inSPersistentEntity.schedulePersisting(ConfigAction)orSPersistentEntity.scheduleRemove(ConfigAction)methods to describe the performed action.- Specified by:
createConfigActionin interfaceProjectEx- Specified by:
createConfigActionin interfaceSPersistentEntity- Parameters:
user- user who performs operation, or null if operation is performed by the systemdescription- description to set to the config action object- Returns:
- new config action
-
getVirtualBuildTypes
@NotNull public List<SBuildType> getVirtualBuildTypes()
- Specified by:
getVirtualBuildTypesin interfaceProjectEx
-
-