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 class
ProjectImpl.Cached<T>
-
Field Summary
Fields Modifier and Type Field Description static String
AUTOMATIC_ARCHIVE_COMMENT
static String
AUTOMATIC_DEARCHIVE_COMMENT
static String
AUTOMATIC_PAUSE_COMMENT
static String
AUTOMATIC_UNPAUSE_COMMENT
static String
PROJECT_CREDENTIALS_STORAGE_PROP_NAME
static String
TEAMCITY_SETTINGS_READ_ONLY_PARAM
static String
TEAMCITY_SETTINGS_RUN_BUTTON_CAPTION_PARAM
static String
TEAMCITY_VIRTUAL_PROJECT_PARAM
static String
VERSIONED_SETTINGS_STORAGE_KEY
-
Fields inherited from interface jetbrains.buildServer.BuildProject
ROOT_PROJECT_ID
-
Fields inherited from interface jetbrains.buildServer.serverSide.CleanupSettings
CLEANUP_PREVENT_DEPENDENCIES_ARTIFACTS_FROM_CLEANUP, DISABLE_CLEANUP_POLICIES
-
-
Constructor Summary
Constructors Constructor Description 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 void
addBuildTypeTemplate(BuildTypeTemplateEx template)
Stores build type template in the project, should be used when templates are loaded from configuration files.void
addCleanupPolicy(HistoryRetentionPolicy policy)
Sets cleanup policy for this build configurationvoid
addDefaultTemplateListener()
SProjectFeatureDescriptor
addFeature(String id, String type, Map<String,String> params)
Adds new project feature with provided ID if auto-generated ID is not desirableSProjectFeatureDescriptor
addFeature(String type, Map<String,String> params)
Adds new project feature.void
addFeature(SProjectFeatureDescriptor feature)
Adds project feature.void
addParameter(Parameter param)
Adds parameter.void
attachedToModel(ProjectDataModel model)
void
attachEnforcedSettings(BuildTypeTemplate typeTemplateEx)
boolean
belongsTo(SProject project)
Returns true if the specified project is or contains (including transitively) this project.void
buildTypeCreated(SBuildType newBuildType, SBuildType originalBuildType, BuildTypeTemplate template)
void
checkCyclicDependencies(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 templatevoid
checkCyclicDependency(Collection<SBuildType> buildTypes, Dependency dependency)
Checks if a snapshot dependency creates a cycle if added to the provided build type.void
clearDefaultTemplateIdCacheForSelfAndChildren()
void
clearProjectPathCache()
int
compareTo(BuildProject o)
boolean
containsBuildType(String buildTypeId)
Returns true if this project or one of subprojects has own build configuration with specified id.SBuildType
copyBuildType(SBuildType originalBuildType, String extId, String name, CopyOptions copyOptions)
Creates a copy of the given build configuration.SBuildType
copyBuildType(SBuildType originalBuildType, String extId, String name, CopyOptions copyOptions, BuildTypeCopyMap copiedObjects)
BuildTypeTemplate
copyBuildTypeTemplate(BuildTypeTemplate original, String extId, String name)
Creates new template by copying settings from the original one.BuildTypeTemplateEx
copyTemplate(BuildTypeTemplateEx template, String extId, String name, CopyOptions options)
SVcsRootEx
copyVcsRoot(SVcsRoot originalRoot, String externalId)
Creates a copy of original VCS root in this project.BuildTypeEx
createBuildType(String name)
Creates new build configuration with given nameBuildTypeEx
createBuildType(String extId, String name)
Creates new build configuration with given external identifier and name.BuildTypeEx
createBuildType(String name, String runnerType, int maxBuilds, BuildTypeDescriptor.CheckoutType checkoutType)
Creates a new build configurationBuildTypeEx
createBuildType(String extId, String name, Consumer<BuildTypeEx> init)
BuildTypeEx
createBuildType(EntityId<String> entityId, boolean emptyUuid, String name, Consumer<BuildTypeEx> init)
SBuildType
createBuildType(SBuildType originalBuildType, String newConfigurationName, boolean copyVcsRoots, boolean changeScopeOfLocalVcsRoots)
SBuildType
createBuildType(SBuildType originalBuildType, String newName, CopyOptions copyOptions)
Creates new build configuration on the base of the specified original build configuration.BuildTypeEx
createBuildTypeFromTemplate(BuildTypeTemplate template, String extId, String name)
Creates build configuration on the base of specified template.BuildTypeEx
createBuildTypeFromTemplate(BuildTypeTemplate template, String extId, String name, Consumer<BuildTypeEx> init)
SBuildType
createBuildTypeFromTemplate(BuildTypeTemplate template, String name, CopyOptions copyOptions)
Creates build configuration on the base of specified template.BuildTypeTemplateEx
createBuildTypeTemplate(String name)
Creates new build configuration template.BuildTypeTemplateEx
createBuildTypeTemplate(String extId, String name)
Creates new build configuration template with given external identifier an name.BuildTypeTemplate
createBuildTypeTemplate(BuildTypeTemplate original, String name, CopyOptions copyOptions)
Creates new template by copying settings from the original one.BuildTypeTemplate
createBuildTypeTemplate(SBuildType originalBuildType, String name, CopyOptions copyOptions)
Extracts a template from the specified build type.ConfigActionEx
createConfigAction(SUser user, String description)
Creates a config action instance associated with this entity and having the specified description.SVcsRoot
createDummyVcsRoot(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.ProjectEx
createProject(String externalId, String projectName)
Creates new sub project in this projectProjectEx
createProjectNoAudit(String externalId, String projectName)
ProjectEx
createProjectNoAudit(String externalId, String projectName, boolean archived)
SVcsRootEx
createVcsRoot(String vcsName, String externalId, String name)
Creates new VCS root in this projectSVcsRootEx
createVcsRoot(String vcsName, String name, Map<String,String> params)
Creates new VCS root in this projectProjectEx
createVirtualProject(String externalId, String projectName)
String
describe(boolean verbose)
void
dispose()
Must be called when this project object is removed from the model.boolean
equals(Object that)
BuildTypeTemplate
extractBuildTypeTemplate(SBuildType originalBuildType, String extId, String name)
Extracts a template from the specified build type.SBuildType
findBuildTypeByExternalId(String externalId)
Searches for a build configuration in this and nested projects by the specified external id.BuildTypeImpl
findBuildTypeById(String internalId)
Searches for a build configuration in this and nested projects by the specified internal id.SBuildType
findBuildTypeByName(String name)
Searches for a build configuration with specified name among own build configurations of this project (not in subprojects).BuildTypeIdentity
findBuildTypeIdentityByName(String name)
Looks for a build template or a configuration with specified name among own build template and configurations of this project.BuildTypeTemplate
findBuildTypeTemplateByExternalId(String extId)
Searches for build type template by given external id in this and nested project.BuildTypeTemplate
findBuildTypeTemplateById(String intId)
Searches for build type template by given internal id in this and nested projects.BuildTypeTemplate
findBuildTypeTemplateByName(String name)
Searches for a template with specified name in this project (not in subprojects).SProjectFeatureDescriptor
findFeatureById(String featureId)
Finds project feature by id.File
findPluginSettings(String pluginName, String fileNme)
Search for a plugin settings file for given project.ProjectEx
findProjectByName(String projectName)
Returns own sub project with specified name (case insensitive) or null if there is no such project.SVcsRoot
findVcsRootByName(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.Date
getArchivingTime()
Returns the date when the project was archived.User
getArchivingUser()
Returns the user who archived the project.List<File>
getArtifactDirectories()
File
getArtifactsDirectory()
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).File
getConfigDirectory()
Returns this project configuration directory, i.e.String
getConfigId()
Returns the entity's config identifier.File
getConfigurationFile()
Returns this project configuration file, named "project-config.xml" in project configuration directoryFile
getConfigurationFile(File projectsDir)
Returns the configuration file where this entity is persisted in custom projects directoryCredentialsStorage
getCredentialsStorage()
String
getCredentialsStorageType()
CustomDataStorage
getCustomDataStorage(String storageId)
Returns a custom data storage for the given storage id associated with this projectBuildTypeTemplateEx
getDefaultTemplate()
Returns a default template effective in the projectString
getDefaultTemplateId()
Returns an internal id of a default template effective in the projectString
getDescription()
Returns project descriptionString
getEditableSettingsNote()
Returns admin area header note text to be shown if this project is editable or null if no note should be shownProjectSettingsGenerator
getEffectiveGenerator()
Same asVersionedSettingsManager.getEffectiveGenerator(SProject)
, but returns null if generator is not found instead of throwing an errorEnforcedSettings
getEnforcedSettings()
String
getExtendedFullName()
Returns the full name of the project with additional note if the project is archived, i.e.String
getExtendedName()
Returns the name of the project with additional note if the project is archived, i.e.String
getExternalId()
Returns the external project identifier.String
getFullName()
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()
AuditLogAction
getLastConfigModificationAction()
protected BuildServerListener
getMulticaster()
String
getName()
Returns project nameString
getNextAvailableFeatureId(String type, Map<String,String> params)
Returns a generated ID that will be used by the next feature added to this projectString
getOrCreateToken(String secret, String contextDescription)
For a specified secret (password, API key, etc) creates a token which can be used in project settings instead.SProject
getOrganizationProject()
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()
CleanupSettingsSupport
getOwnCleanupSettingsSupport()
BuildTypeTemplateEx
getOwnDefaultTemplate()
Returns a default template defined in the projectString
getOwnDefaultTemplateExternalId()
String
getOwnDefaultTemplateId()
Returns an internal id of a default template defined in the projectProjectEnforcedSettings
getOwnEnforcedSettings()
Collection<SProjectFeatureDescriptor>
getOwnFeatures()
Collection<SProjectFeatureDescriptor>
getOwnFeaturesOfType(String type)
Parameter
getOwnNonInheritedParameter(String paramName)
Own parameter without inherited parameter spec.Parameter
getOwnParameter(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)SerializableParametersCollection
getOwnSerializableParameters()
List<SVcsRoot>
getOwnVcsRoots()
Returns VCS roots associated with this certain project.Parameter
getParameter(String paramName)
Map<String,String>
getParameters()
Returns map of build and configuration parameters.Collection<Parameter>
getParametersCollection()
Returns build and configuration parameters in single collection.ParametersProvider
getParametersProvider()
Returns parameters which can be used by value resolver.ContainerWithInherited<String,Parameter>
getParametersSupport()
String
getParameterValue(String paramName)
SPersistentEntity
getParent()
The parent entity.ProjectEx
getParentProject()
Returns the parent of this project.String
getParentProjectExternalId()
Returns external id of the parent project of this project.String
getParentProjectId()
Returns internal id of the parent project of this project.File
getPluginDataDirectory(String pluginName)
Returns plugin data directory for given plugin nameFile
getPluginSettingsFile()
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.ProjectDataModel
getProjectDataModel()
String
getProjectId()
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.ReadOnlyReason
getReadOnlyReason()
String
getSecureValue(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 storageStatus
getStatus()
Returns project status calculated according to cumulative status of all build configurations registered in the project.Status
getStatus(String branch)
String
getTokenContext(String token)
Map<String,String>
getTokensWithoutSecret()
List<SVcsRoot>
getUsedVcsRoots()
ValueResolver
getValueResolver()
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.PersistentEntityVersion
getVersion()
Returns version of this entity which can be used to check if the entity was edited or persisted.SVcsRoot
getVersionedSettingsVcsRoot()
List<SBuildType>
getVirtualBuildTypes()
boolean
hasBuildTypes()
Returns true if this project contains at least one own build configurationint
hashCode()
boolean
hasSettingsWithSecureValues()
boolean
hasVersionedSettings()
Returns true if this project stores its settings in VCS, false otherwisevoid
init(ProjectExternalizer externalizer)
void
initArchivedStatus(boolean archived)
Initializes project's archived flag.boolean
isArchived()
Returns true if the project is archivedboolean
isDefaultBranchExcluded()
Returns true if all project's own buildTypes exclude the default branch.boolean
isEmptyUuid()
boolean
isExtIdChangeSupported()
Returns true if extId can be changed in this project and all its entitiesboolean
isInModel()
Return true if this project is attached to the TeamCity project model.boolean
isMoveEntitiesSupported()
Returns true if project settings format supports move of entities in projects hierarchyboolean
isMoveSupported()
Returns true if project settings format supports move of the project with all its entities in projects hierarchyboolean
isProjectCreateSupported()
Returns true if format supports new project creationboolean
isProjectDeleteSupported()
Returns true if project settings format supports delete of the projectboolean
isReadOnly()
boolean
isRootProject()
Returns true iff this project is root projectboolean
isVirtual()
Returns true for so-called virtual projects.void
markPersisted(long expectedEditId)
Marks entity as persistedvoid
moveToProject(ConfigAction cause, SProject target)
Moves this project to the target project.void
moveToProject(SProject target)
Moves this project to the target project.void
persist()
Persists this project configuration on disk.void
persist(ConfigAction cause)
Persists this entity on disk.void
remove()
Removes this entity.void
removeBuildType(String internalId)
Removes build configuration with specified internal idvoid
removeBuildTypes()
Unregisters all build types and templates.void
removeBuildTypeTemplate(String internalId)
Deprecated.void
removeCleanupPolicies()
Remove all own cleanup policies for the objectvoid
removeDefaultTemplateListener()
SProjectFeatureDescriptor
removeFeature(String featureId)
Removes project feature with specified id.void
removeParameter(String paramName)
Removes parameter.boolean
replaceInValues(Pattern regexp, String replacement)
Processes project settings and replaces all values matched by regexp to specified replacement string.protected void
resetCachedReadOnlyReason(boolean resetInSubProjects)
void
resortBuildTypes()
Resorts build configurations containedboolean
saveSettingsBranchSpec(VcsRootInstance root, BranchSpec spec)
Updates versioned settings root and branch spec last used for changes collecting.PersistTask
scheduleFileDelete(ConfigAction cause, String pathInProjectDir)
PersistTask
scheduleFileSave(ConfigAction cause, String pathInProjectDir, byte[] fileContent)
BackgroundPersistTask
schedulePersisting(String reason)
Schedules background persisting of this entity settings.BackgroundPersistTask
schedulePersisting(ConfigAction cause)
Schedules background persisting of this project settings.void
scheduleProjectConfigurationReload()
Schedules background task to reload project configuration from disk.PersistTask
scheduleRemove(ConfigAction cause)
Schedules remove of this persistent entity.void
sendExtIdChangedEvents(ConfigAction cause, String oldExternalId, String newExternalId)
void
setArchived(boolean archived, User user)
Sets project's and sub project's archived flags, pauses build configurations.void
setCleanupOption(String option, Boolean value)
Sets value for a cleanup optionvoid
setDefaultTemplate(BuildTypeTemplate template)
void
setDescription(String description)
Sets this project descriptionvoid
setEditable(boolean editable)
Enables or disables editing of the project in web UI, see alsoSPersistentEntity.isReadOnly()
.void
setEnforcedSettings(ProjectEnforcedSettings enforcedSettings)
Attach enforced settings profile to this project.void
setExternalId(String newId)
Sets the external project id.void
setExternalId(ConfigAction cause, String newId)
Sets the external project id.void
setExternalId(ConfigAction cause, String newId, boolean sendEvents)
void
setName(String name)
Renames projectvoid
setOwnBuildTypesOrder(List<String> internalIds)
void
setOwnProjectsOrder(List<String> internalIds)
void
storeBuildType(BuildTypeImpl buildType)
String
toString()
void
unregister()
Tries to unregister this project from the model.boolean
updateFeature(String featureId, String newType, Map<String,String> newParams)
Updates type and parameters of project feature with specified id.void
updateParentInternally(EntityId<String> newParentId)
void
validateNewExtId(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:SProject
Returns this project configuration file, named "project-config.xml" in project configuration directory- Specified by:
getConfigurationFile
in interfaceSPersistentEntity
- Specified by:
getConfigurationFile
in interfaceSProject
- Returns:
- this project configuration file
-
getConfigurationFile
@NotNull public File getConfigurationFile(@NotNull File projectsDir)
Description copied from interface:SPersistentEntity
Returns the configuration file where this entity is persisted in custom projects directory- Specified by:
getConfigurationFile
in interfaceSPersistentEntity
- Parameters:
projectsDir
- path to teamcity projects directory- Returns:
- see above
-
getPluginSettingsFile
@NotNull public File getPluginSettingsFile()
Description copied from interface:SProject
Returns the plugin settings file for this project scope settings.- Specified by:
getPluginSettingsFile
in interfaceSProject
- Returns:
- see plugin settings file (an XML file).
-
containsBuildType
public boolean containsBuildType(@NotNull String buildTypeId)
Description copied from interface:SProject
Returns true if this project or one of subprojects has own build configuration with specified id.- Specified by:
containsBuildType
in 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:ProjectEx
Creates new build configuration with given external identifier and name.- Specified by:
createBuildType
in interfaceProjectEx
- Specified by:
createBuildType
in 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:
createBuildType
in interfaceProjectEx
- Throws:
DuplicateExternalIdException
DuplicateBuildTypeNameException
MaxNumberOfBuildTypesReachedException
-
createBuildType
@NotNull public BuildTypeEx createBuildType(@NotNull EntityId<String> entityId, boolean emptyUuid, @NotNull String name, @Nullable Consumer<BuildTypeEx> init) throws DuplicateExternalIdException, DuplicateBuildTypeNameException, MaxNumberOfBuildTypesReachedException
- Specified by:
createBuildType
in interfaceProjectEx
- Throws:
DuplicateExternalIdException
DuplicateBuildTypeNameException
MaxNumberOfBuildTypesReachedException
-
createBuildType
@NotNull public BuildTypeEx createBuildType(@NotNull String name) throws DuplicateBuildTypeNameException, MaxNumberOfBuildTypesReachedException
Description copied from interface:SProject
Creates new build configuration with given name- Specified by:
createBuildType
in interfaceProjectEx
- Specified by:
createBuildType
in interfaceSProject
- 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:ProjectEx
Validates the given extId in this project- Specified by:
validateNewExtId
in interfaceProjectEx
- Parameters:
extId
- id to validate
-
scheduleProjectConfigurationReload
public void scheduleProjectConfigurationReload()
Description copied from interface:ProjectEx
Schedules background task to reload project configuration from disk.- Specified by:
scheduleProjectConfigurationReload
in interfaceProjectEx
-
createBuildType
@NotNull public BuildTypeEx createBuildType(@NotNull String name, @NotNull String runnerType, int maxBuilds, BuildTypeDescriptor.CheckoutType checkoutType) throws DuplicateBuildTypeNameException, MaxNumberOfBuildTypesReachedException
Description copied from interface:SProject
Creates a new build configuration- Specified by:
createBuildType
in interfaceProjectEx
- Specified by:
createBuildType
in 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:SProject
Creates new build configuration template with given external identifier an name.- Specified by:
createBuildTypeTemplate
in interfaceProjectEx
- Specified by:
createBuildTypeTemplate
in 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:SProject
Creates new build configuration template.- Specified by:
createBuildTypeTemplate
in interfaceProjectEx
- Specified by:
createBuildTypeTemplate
in 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:SProject
Return true if this project is attached to the TeamCity project model.
-
getPotentiallyResponsibleUsers
public List<User> getPotentiallyResponsibleUsers()
Description copied from interface:SProject
Returns the list of users who potentially can be responsible for failures in this project.- Specified by:
getPotentiallyResponsibleUsers
in interfaceSProject
- Returns:
- users who committed to this project within last 5 days.
-
findProjectByName
@Nullable public ProjectEx findProjectByName(@NotNull String projectName)
Description copied from interface:SProject
Returns own sub project with specified name (case insensitive) or null if there is no such project.- Specified by:
findProjectByName
in interfaceProjectEx
- Specified by:
findProjectByName
in 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:SProject
Creates new sub project in this project- Specified by:
createProject
in interfaceProjectEx
- Specified by:
createProject
in interfaceSProject
- Parameters:
externalId
- new sub project idprojectName
- new sub project name- Returns:
- newly created sub project
- Throws:
InvalidIdentifierException
InvalidNameException
DuplicateProjectNameException
DuplicateExternalIdException
-
createVirtualProject
public ProjectEx createVirtualProject(@NotNull String externalId, @NotNull String projectName)
- Specified by:
createVirtualProject
in interfaceProjectEx
-
createProjectNoAudit
@NotNull public ProjectEx createProjectNoAudit(@NotNull String externalId, @NotNull String projectName, boolean archived) throws InvalidIdentifierException, InvalidNameException, DuplicateProjectNameException, DuplicateExternalIdException
- Specified by:
createProjectNoAudit
in interfaceProjectEx
- Throws:
InvalidIdentifierException
InvalidNameException
DuplicateProjectNameException
DuplicateExternalIdException
-
createProjectNoAudit
@NotNull public ProjectEx createProjectNoAudit(@NotNull String externalId, @NotNull String projectName) throws InvalidIdentifierException, InvalidNameException, DuplicateProjectNameException, DuplicateExternalIdException
- Specified by:
createProjectNoAudit
in interfaceProjectEx
- Throws:
InvalidIdentifierException
InvalidNameException
DuplicateProjectNameException
DuplicateExternalIdException
-
createBuildType
@NotNull public SBuildType createBuildType(SBuildType originalBuildType, String newConfigurationName, boolean copyVcsRoots, boolean changeScopeOfLocalVcsRoots) throws MaxNumberOfBuildTypesReachedException
- Specified by:
createBuildType
in interfaceSProject
- Throws:
MaxNumberOfBuildTypesReachedException
-
copyBuildTypeTemplate
@NotNull public BuildTypeTemplate copyBuildTypeTemplate(@NotNull BuildTypeTemplate original, @NotNull String extId, @NotNull String name)
Description copied from interface:SProject
Creates new template by copying settings from the original one.- Specified by:
copyBuildTypeTemplate
in interfaceSProject
- 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:SProject
Creates new template by copying settings from the original one.- Specified by:
createBuildTypeTemplate
in 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:SProject
Extracts a template from the specified build type.- Specified by:
extractBuildTypeTemplate
in 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:SProject
Extracts a template from the specified build type.- Specified by:
createBuildTypeTemplate
in 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:
copyTemplate
in 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:SProject
Creates a copy of the given build configuration.- Specified by:
copyBuildType
in 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:
copyBuildType
in interfaceProjectEx
- Throws:
MaxNumberOfBuildTypesReachedException
DuplicateExternalIdException
-
createBuildType
@NotNull public SBuildType createBuildType(@NotNull SBuildType originalBuildType, @NotNull String newName, @NotNull CopyOptions copyOptions) throws MaxNumberOfBuildTypesReachedException, InvalidVcsRootScopeException
Description copied from interface:SProject
Creates new build configuration on the base of the specified original build configuration.- Specified by:
createBuildType
in 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:SProject
Creates build configuration on the base of specified template.- Specified by:
createBuildTypeFromTemplate
in 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:
createBuildTypeFromTemplate
in interfaceProjectEx
- Throws:
MaxNumberOfBuildTypesReachedException
InvalidVcsRootScopeException
DuplicateExternalIdException
-
createBuildTypeFromTemplate
@NotNull public SBuildType createBuildTypeFromTemplate(@NotNull BuildTypeTemplate template, @NotNull String name, @NotNull CopyOptions copyOptions) throws MaxNumberOfBuildTypesReachedException, InvalidVcsRootScopeException
Description copied from interface:SProject
Creates build configuration on the base of specified template.- Specified by:
createBuildTypeFromTemplate
in 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:SProject
Looks for a build template or a configuration with specified name among own build template and configurations of this project.- Specified by:
findBuildTypeIdentityByName
in 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:SProject
Searches for a build configuration with specified name among own build configurations of this project (not in subprojects).- Specified by:
findBuildTypeByName
in 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:SProject
Searches for a build configuration in this and nested projects by the specified internal id.- Specified by:
findBuildTypeById
in 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:SProject
Searches for a build configuration in this and nested projects by the specified external id.- Specified by:
findBuildTypeByExternalId
in 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:
removeBuildTypes
in interfaceSProject
-
removeBuildTypeTemplate
@Deprecated public void removeBuildTypeTemplate(@NotNull String internalId) throws TemplateCannotBeRemovedException
Deprecated.Description copied from interface:SProject
Removes build configuration template- Specified by:
removeBuildTypeTemplate
in 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:SProject
Removes build configuration with specified internal id- Specified by:
removeBuildType
in interfaceSProject
- Parameters:
internalId
- internal id of the build configuration
-
getId
@NotNull public EntityId<String> getId()
Description copied from interface:ProjectEx
Returns the project id.
-
getProjectId
@NotNull public String getProjectId()
Description copied from interface:BuildProject
Returns 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:
getProjectId
in interfaceBuildProject
- Returns:
- internal id.
- See Also:
BuildProject.getExternalId()
-
getConfigId
@NotNull public String getConfigId()
Description copied from interface:SPersistentEntity
Returns 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:
getConfigId
in interfaceSPersistentEntity
-
getExternalId
@NotNull public String getExternalId()
Description copied from interface:BuildProject
Returns the external project identifier.- Specified by:
getExternalId
in interfaceBuildProject
- Specified by:
getExternalId
in interfaceSPersistentEntity
- Returns:
- external identifier.
- See Also:
BuildProject.getProjectId()
-
getParentProject
@Nullable public ProjectEx getParentProject()
Description copied from interface:SProject
Returns 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:
getParentProject
in interfaceBuildProject
- Specified by:
getParentProject
in interfaceProjectEx
- Specified by:
getParentProject
in 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:BuildProject
Returns internal id of the parent project of this project.Every project, except the root one, has a parent project.
- Specified by:
getParentProjectId
in 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:SPersistentEntity
The parent entity.- Specified by:
getParent
in interfaceSPersistentEntity
- Returns:
- see above.
-
getParentProjectExternalId
@Nullable public String getParentProjectExternalId()
Description copied from interface:BuildProject
Returns external id of the parent project of this project.Every project, except the root one, has a parent project.
- Specified by:
getParentProjectExternalId
in 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:SProject
The tree path in project hierarchy from the root project to this one (in other words, all parents of this and this one).- Specified by:
getProjectPath
in 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:SProject
Returns only own sub projects of this project.- Specified by:
getOwnProjects
in interfaceBuildProject
- Specified by:
getOwnProjects
in interfaceSProject
- Returns:
- list of projects sorted by name
-
getProjects
@NotNull public List<SProject> getProjects()
Description copied from interface:SProject
Returns all sub projects of this project transitively.- Specified by:
getProjects
in interfaceBuildProject
- Specified by:
getProjects
in interfaceSProject
- Returns:
- list of projects sorted by name
-
getName
@NotNull public String getName()
Description copied from interface:BuildProject
Returns project name- Specified by:
getName
in interfaceBuildProject
- Specified by:
getName
in interfaceSPersistentEntity
- Returns:
- presentable name
-
getFullName
@NotNull public String getFullName()
Description copied from interface:BuildProject
Returns 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:
getFullName
in interfaceBuildProject
- Returns:
- presentable name
-
setExternalId
public void setExternalId(@NotNull String newId) throws InvalidIdentifierException, DuplicateExternalIdException
Description copied from interface:SProject
Sets the external project id.All such project identifiers must be unique case insensitively.
This method performs persisting. You don't need to call persist when this method done.
- Specified by:
setExternalId
in interfaceSProject
- Parameters:
newId
- the new external project identifier.- Throws:
InvalidIdentifierException
DuplicateExternalIdException
-
setExternalId
public void setExternalId(@NotNull ConfigAction cause, @NotNull String newId) throws InvalidIdentifierException, DuplicateExternalIdException
Description copied from interface:SProject
Sets the external project id.All such project identifiers must be unique case insensitively.
This method performs persisting and changes the disk structure immediately. You don't need to call persist when this method done.
- Specified by:
setExternalId
in interfaceSProject
newId
- the new external project identifier.- Throws:
InvalidIdentifierException
DuplicateExternalIdException
-
setExternalId
public void setExternalId(@NotNull ConfigAction cause, @NotNull String newId, boolean sendEvents) throws InvalidIdentifierException, DuplicateExternalIdException
- Specified by:
setExternalId
in interfaceProjectEx
- Throws:
InvalidIdentifierException
DuplicateExternalIdException
-
sendExtIdChangedEvents
public void sendExtIdChangedEvents(@NotNull ConfigAction cause, @NotNull String oldExternalId, @NotNull String newExternalId)
- Specified by:
sendExtIdChangedEvents
in interfaceProjectEx
-
isRootProject
public final boolean isRootProject()
Description copied from interface:BuildProject
Returns true iff this project is root project- Specified by:
isRootProject
in interfaceBuildProject
- Returns:
- see above
-
moveToProject
public void moveToProject(@NotNull SProject target) throws CyclicDependencyException, InvalidVcsRootScopeException
Description copied from interface:SProject
Moves this project to the target project.- Specified by:
moveToProject
in interfaceSProject
- Parameters:
target
- new parent project for this project- Throws:
CyclicDependencyException
InvalidVcsRootScopeException
-
moveToProject
public void moveToProject(@NotNull ConfigAction cause, @NotNull SProject target) throws CyclicDependencyException, InvalidVcsRootScopeException
Description copied from interface:SProject
Moves this project to the target project.- Specified by:
moveToProject
in interfaceSProject
- Parameters:
cause
- config action caused the changetarget
- new parent project for this project- Throws:
CyclicDependencyException
InvalidVcsRootScopeException
-
checkCyclicDependencies
public void checkCyclicDependencies(@NotNull SBuildType buildType)
Description copied from interface:ProjectEx
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 template- Specified by:
checkCyclicDependencies
in interfaceProjectEx
-
checkCyclicDependency
public void checkCyclicDependency(@NotNull Collection<SBuildType> buildTypes, @NotNull Dependency dependency)
Description copied from interface:ProjectEx
Checks if a snapshot dependency creates a cycle if added to the provided build type.- Specified by:
checkCyclicDependency
in interfaceProjectEx
- Parameters:
buildTypes
- see abovedependency
- see above
-
copyVcsRoot
@NotNull public SVcsRootEx copyVcsRoot(@NotNull SVcsRoot originalRoot, @Nullable String externalId)
Description copied from interface:SProject
Creates a copy of original VCS root in this project.- Specified by:
copyVcsRoot
in interfaceProjectEx
- Specified by:
copyVcsRoot
in interfaceSProject
- Parameters:
originalRoot
- original VCS root.externalId
- external id for the copy; if null the the external id will be generated automatically.- Returns:
- VCS root copy
-
createVcsRoot
@NotNull public SVcsRootEx createVcsRoot(@NotNull String vcsName, @Nullable String name, @NotNull Map<String,String> params)
Description copied from interface:SProject
Creates new VCS root in this project- Specified by:
createVcsRoot
in interfaceProjectEx
- Specified by:
createVcsRoot
in interfaceSProject
- Parameters:
vcsName
- name of VCS pluginname
- name of VCS root, if null or empty new name will be generated automaticallyparams
- VCS root parameters- Returns:
- newly created VCS root
-
createVcsRoot
@NotNull public SVcsRootEx createVcsRoot(@NotNull String vcsName, @NotNull String externalId, @NotNull String name) throws InvalidIdentifierException, DuplicateExternalIdException, DuplicateVcsRootNameException
Description copied from interface:SProject
Creates new VCS root in this project- Specified by:
createVcsRoot
in interfaceSProject
- 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:SProject
Creates a dummy VCS root which cannot be persisted, but can be used in cases when project specific VCS operation must be performed.- Specified by:
createDummyVcsRoot
in interfaceSProject
- Parameters:
vcsName
- name of VCS pluginparameters
- VCS root properties- Returns:
- see above
-
setName
public void setName(@NotNull String name)
Description copied from interface:SProject
Renames project
-
setDescription
public void setDescription(@Nullable String description)
Description copied from interface:SProject
Sets this project description- Specified by:
setDescription
in interfaceSProject
- Parameters:
description
- new project description
-
getDescription
@NotNull public String getDescription()
Description copied from interface:BuildProject
Returns project description- Specified by:
getDescription
in interfaceBuildProject
- Returns:
- project description
-
getOwnBuildTypes
@NotNull public List<SBuildType> getOwnBuildTypes()
Description copied from interface:SProject
Returns all build configurations registered in this certain project. Does NOT include build configurations from subprojects.- Specified by:
getOwnBuildTypes
in interfaceBuildProject
- Specified by:
getOwnBuildTypes
in interfaceSProject
- Returns:
- list of build configurations sorted by name
-
getBuildTypes
@NotNull public List<SBuildType> getBuildTypes()
Description copied from interface:SProject
Returns all build configurations registered in this project and all its subprojects (not only direct subprojects, but all).- Specified by:
getBuildTypes
in interfaceBuildProject
- Specified by:
getBuildTypes
in interfaceSProject
- Returns:
- list of build configurations sorted by name
-
getOwnVcsRoots
@NotNull public List<SVcsRoot> getOwnVcsRoots()
Description copied from interface:SProject
Returns VCS roots associated with this certain project. Does NOT include VCS roots from subprojects.- Specified by:
getOwnVcsRoots
in interfaceBuildProject
- Specified by:
getOwnVcsRoots
in interfaceSProject
- Returns:
- list of VCS roots sorted by VCS root name
-
findVcsRootByName
@Nullable public SVcsRoot findVcsRootByName(@NotNull String name)
Description copied from interface:SProject
Returns own VCS root with given name or null if project does not have such VCS root- Specified by:
findVcsRootByName
in interfaceSProject
- Parameters:
name
- name of VCS root- Returns:
- found VCS root or null
-
getVcsRoots
@NotNull public List<SVcsRoot> getVcsRoots()
Description copied from interface:SProject
Returns all VCS roots associated with this project and all its subprojects transitively.- Specified by:
getVcsRoots
in interfaceBuildProject
- Specified by:
getVcsRoots
in interfaceSProject
- Returns:
- list of vcs roots
-
getUsedVcsRoots
@NotNull public List<SVcsRoot> getUsedVcsRoots()
- Specified by:
getUsedVcsRoots
in 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:
getVcsRootInstances
in interfaceSProject
- Returns:
- all VCS root instances used in the project and subprojects.
-
hasBuildTypes
public boolean hasBuildTypes()
Description copied from interface:SProject
Returns true if this project contains at least one own build configuration- Specified by:
hasBuildTypes
in interfaceSProject
- Returns:
- true if this project has it's own build configurations
-
persist
public void persist()
Description copied from interface:SProject
Persists this project configuration on disk.- Specified by:
persist
in interfaceSPersistentEntity
- Specified by:
persist
in interfaceSProject
-
persist
public void persist(@NotNull ConfigAction cause) throws PersistFailedException
Description copied from interface:SPersistentEntity
Persists this entity on disk.- Specified by:
persist
in 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:SPersistentEntity
Schedules background persisting of this project settings.- Specified by:
schedulePersisting
in 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:
scheduleFileSave
in interfaceProjectEx
- Throws:
PersistFailedException
-
scheduleFileDelete
@NotNull public PersistTask scheduleFileDelete(@NotNull ConfigAction cause, @NotNull String pathInProjectDir)
- Specified by:
scheduleFileDelete
in interfaceProjectEx
-
schedulePersisting
@NotNull public BackgroundPersistTask schedulePersisting(@NotNull String reason) throws PersistFailedException
Description copied from interface:SPersistentEntity
Schedules background persisting of this entity settings.- Specified by:
schedulePersisting
in 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:
getLastConfigModificationAction
in interfaceProjectEx
-
isArchived
public boolean isArchived()
Description copied from interface:SProject
Returns true if the project is archived- Specified by:
isArchived
in interfaceSProject
- Returns:
- true if the project is archived
-
setArchived
public void setArchived(boolean archived, @Nullable User user)
Description copied from interface:SProject
Sets project's and sub project's archived flags, pauses build configurations. Persists configuration changes on disk.- Specified by:
setArchived
in interfaceSProject
- Parameters:
archived
- is the project archiveduser
- the user the performs the action
-
getArchivingUser
@Nullable public User getArchivingUser()
Description copied from interface:SProject
Returns the user who archived the project. Returns null, if project is active, or the action author is unknown.- Specified by:
getArchivingUser
in interfaceSProject
- Returns:
- user who archived the project
-
getArchivingTime
@Nullable public Date getArchivingTime()
Description copied from interface:SProject
Returns the date when the project was archived. Returns null, if project is active, or the action author is unknown.- Specified by:
getArchivingTime
in interfaceSProject
- Returns:
- archiving time
-
getExtendedName
@NotNull public String getExtendedName()
Description copied from interface:SProject
Returns 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:
getExtendedName
in interfaceSProject
- Returns:
- extended project name
- See Also:
BuildProject.getName()
-
getExtendedFullName
@NotNull public String getExtendedFullName()
Description copied from interface:SProject
Returns 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:
getExtendedFullName
in interfaceSProject
- Returns:
- extended full project name
- See Also:
BuildProject.getFullName()
-
getOwnBuildTypeTemplates
@NotNull public List<BuildTypeTemplate> getOwnBuildTypeTemplates()
Description copied from interface:SProject
Returns build configuration templates registered in this certain project. Does NOT include build configuration templates from subprojects.- Specified by:
getOwnBuildTypeTemplates
in interfaceSProject
- Returns:
- list of build configuration templates sorted by name
-
getBuildTypeTemplates
@NotNull public List<BuildTypeTemplate> getBuildTypeTemplates()
Description copied from interface:SProject
Returns all build configuration templates registered in this project and all its subprojects (not only direct).- Specified by:
getBuildTypeTemplates
in interfaceSProject
- Returns:
- list of build configuration templates sorted by name
-
getAvailableTemplates
@NotNull public List<BuildTypeTemplate> getAvailableTemplates()
- Specified by:
getAvailableTemplates
in 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:
getAvailableVcsRoots
in 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:SProject
Searches for build type template by given internal id in this and nested projects.- Specified by:
findBuildTypeTemplateById
in 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:SProject
Searches for build type template by given external id in this and nested project.- Specified by:
findBuildTypeTemplateByExternalId
in 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:SProject
Searches for a template with specified name in this project (not in subprojects).- Specified by:
findBuildTypeTemplateByName
in 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:UserParametersHolder
Adds parameter.- Specified by:
addParameter
in 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:UserParametersHolder
Removes parameter.- Specified by:
removeParameter
in 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:ReadOnlyUserParameters
Returns build and configuration parameters in single collection.- Specified by:
getParametersCollection
in interfaceInheritableUserParametersHolder
- Specified by:
getParametersCollection
in 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:
getParameter
in interfaceReadOnlyUserParameters
-
getParameters
@NotNull public Map<String,String> getParameters()
Description copied from interface:ReadOnlyUserParameters
Returns map of build and configuration parameters.- Specified by:
getParameters
in interfaceInheritableUserParametersHolder
- Specified by:
getParameters
in 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:
getParameterValue
in 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:
getOwnParametersCollection
in interfaceInheritableUserParametersHolder
- Returns:
- own parameters, without inherited. Yet they would have inherited specs or values (if any).
-
getOwnSerializableParameters
@NotNull public SerializableParametersCollection getOwnSerializableParameters()
- Specified by:
getOwnSerializableParameters
in interfaceProjectEx
-
replaceInValues
public boolean replaceInValues(@NotNull Pattern regexp, @NotNull String replacement)
Description copied from interface:ProjectEx
Processes project settings and replaces all values matched by regexp to specified replacement string. Currently works for parameters only.- Specified by:
replaceInValues
in interfaceProjectEx
- Returns:
-
getOwnParameters
@NotNull public Map<String,String> getOwnParameters()
- Specified by:
getOwnParameters
in 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:BuildProject
Returns 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:
getStatus
in interfaceBuildProject
- Returns:
- current project status
-
getConfigDirectory
@NotNull public File getConfigDirectory()
Description copied from interface:SProject
Returns this project configuration directory, i.e. a directory where this project configuration is stored.- Specified by:
getConfigDirectory
in interfaceSProject
- Returns:
- this project configuration directory
-
getArtifactsDirectory
@NotNull public File getArtifactsDirectory()
Description copied from interface:SProject
Returns directory containing all of the project artifacts.- Specified by:
getArtifactsDirectory
in interfaceSProject
- Returns:
- directory containing all of the project artifacts.
-
getPluginDataDirectory
@NotNull public File getPluginDataDirectory(@NotNull String pluginName)
Description copied from interface:SProject
Returns plugin data directory for given plugin name- Specified by:
getPluginDataDirectory
in interfaceSProject
- Returns:
- directory containing some plugin data.
-
compareTo
public int compareTo(@NotNull BuildProject o)
- Specified by:
compareTo
in interfaceComparable<BuildProject>
-
attachedToModel
public void attachedToModel(@NotNull ProjectDataModel model)
- Specified by:
attachedToModel
in interfaceProjectEx
-
remove
public void remove()
Description copied from interface:SPersistentEntity
Removes 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:
remove
in interfaceSPersistentEntity
-
scheduleRemove
@NotNull public PersistTask scheduleRemove(@NotNull ConfigAction cause)
Description copied from interface:SPersistentEntity
Schedules remove of this persistent entity. Returns task which can be used to wait for the operation to complete.- Specified by:
scheduleRemove
in 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:ProjectEx
Must be called when this project object is removed from the model.
-
unregister
public void unregister()
Description copied from interface:ProjectEx
Tries 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:
unregister
in interfaceProjectEx
-
getProjectDataModel
@NotNull public ProjectDataModel getProjectDataModel()
- Specified by:
getProjectDataModel
in interfaceProjectEx
-
getCommitters
@NotNull public List<SUser> getCommitters(int periodInSeconds)
Description copied from interface:ProjectEx
Returns committers to this project for the specified period (in seconds).- Specified by:
getCommitters
in 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:ProjectEx
Resorts build configurations contained- Specified by:
resortBuildTypes
in interfaceProjectEx
-
addBuildTypeTemplate
public void addBuildTypeTemplate(@NotNull BuildTypeTemplateEx template) throws DuplicateTemplateNameException
Description copied from interface:ProjectEx
Stores build type template in the project, should be used when templates are loaded from configuration files.- Specified by:
addBuildTypeTemplate
in 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:SProject
Returns an internal id of a default template effective in the project- Specified by:
getDefaultTemplateId
in interfaceSProject
- Returns:
- see above, null if no default template is found
-
getOwnDefaultTemplateId
@Nullable public String getOwnDefaultTemplateId()
Description copied from interface:SProject
Returns an internal id of a default template defined in the project- Specified by:
getOwnDefaultTemplateId
in interfaceSProject
- Returns:
- see above, null if no default template is found
-
getOwnDefaultTemplateExternalId
public String getOwnDefaultTemplateExternalId()
- Specified by:
getOwnDefaultTemplateExternalId
in interfaceProjectEx
-
getDefaultTemplate
@Nullable public BuildTypeTemplateEx getDefaultTemplate()
Description copied from interface:SProject
Returns a default template effective in the project- Specified by:
getDefaultTemplate
in interfaceSProject
- Returns:
- see above, null if no default template is found
-
getOwnDefaultTemplate
@Nullable public BuildTypeTemplateEx getOwnDefaultTemplate()
Description copied from interface:SProject
Returns a default template defined in the project- Specified by:
getOwnDefaultTemplate
in interfaceSProject
- Returns:
- see above, null if no default template is found
-
setDefaultTemplate
public void setDefaultTemplate(@Nullable BuildTypeTemplate template)
- Specified by:
setDefaultTemplate
in interfaceProjectEx
-
addDefaultTemplateListener
public void addDefaultTemplateListener()
- Specified by:
addDefaultTemplateListener
in interfaceProjectEx
-
removeDefaultTemplateListener
public void removeDefaultTemplateListener()
- Specified by:
removeDefaultTemplateListener
in interfaceProjectEx
-
clearDefaultTemplateIdCacheForSelfAndChildren
public void clearDefaultTemplateIdCacheForSelfAndChildren()
-
getMulticaster
protected BuildServerListener getMulticaster()
-
getParametersProvider
@NotNull public ParametersProvider getParametersProvider()
Description copied from interface:ParametersSupport
Returns 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:
getParametersProvider
in interfaceParametersSupport
- Returns:
- parameters
-
getValueResolver
@NotNull public ValueResolver getValueResolver()
Description copied from interface:ParametersSupport
Returns value resolver which can be used to resolve references in values- Specified by:
getValueResolver
in interfaceParametersSupport
- Returns:
- value resolver
-
describe
@NotNull public String describe(boolean verbose)
-
belongsTo
public boolean belongsTo(@NotNull SProject project)
Description copied from interface:SProject
Returns true if the specified project is or contains (including transitively) this project.
-
getCleanupPolicies
@NotNull public Collection<HistoryRetentionPolicy> getCleanupPolicies()
- Specified by:
getCleanupPolicies
in interfaceCleanupSettings
- Returns:
- combined cleanup policies, including those inherited from default or parent object
-
getOwnCleanupPolicies
@NotNull public Collection<HistoryRetentionPolicy> getOwnCleanupPolicies()
- Specified by:
getOwnCleanupPolicies
in interfaceCleanupSettings
- Returns:
- cleanup policies, specific for this object only
-
getInheritedCleanupPolicies
@NotNull public Collection<HistoryRetentionPolicy> getInheritedCleanupPolicies()
- Specified by:
getInheritedCleanupPolicies
in interfaceCleanupSettings
-
getInheritedCleanupOptions
@NotNull public Map<String,Boolean> getInheritedCleanupOptions()
- Specified by:
getInheritedCleanupOptions
in interfaceCleanupSettings
-
getCleanupOptions
@NotNull public Map<String,Boolean> getCleanupOptions()
- Specified by:
getCleanupOptions
in interfaceCleanupSettings
- Returns:
- map of all cleanup options
-
getOwnCleanupOptions
@NotNull public Map<String,Boolean> getOwnCleanupOptions()
- Specified by:
getOwnCleanupOptions
in interfaceCleanupSettings
- Returns:
- map of own cleanup options only
-
getOwnCleanupSettingsSupport
@NotNull public CleanupSettingsSupport getOwnCleanupSettingsSupport()
- Specified by:
getOwnCleanupSettingsSupport
in interfaceProjectEx
-
addCleanupPolicy
public void addCleanupPolicy(@NotNull HistoryRetentionPolicy policy)
Description copied from interface:CleanupSettingsInit
Sets cleanup policy for this build configuration- Specified by:
addCleanupPolicy
in interfaceCleanupSettingsInit
- Parameters:
policy
- policy to set
-
removeCleanupPolicies
public void removeCleanupPolicies()
Description copied from interface:CleanupSettingsInit
Remove all own cleanup policies for the object- Specified by:
removeCleanupPolicies
in interfaceCleanupSettingsInit
-
setCleanupOption
public void setCleanupOption(@NotNull String option, @Nullable Boolean value)
Description copied from interface:CleanupSettingsInit
Sets value for a cleanup option- Specified by:
setCleanupOption
in interfaceCleanupSettingsInit
- Parameters:
option
- cleanup option (seeCleanupSettings
constants)value
- value to set option to, ornull
to remove the option
-
setOwnProjectsOrder
public void setOwnProjectsOrder(List<String> internalIds)
- Specified by:
setOwnProjectsOrder
in interfaceProjectEx
- Parameters:
internalIds
- Empty list will remove custom ordering
-
setOwnBuildTypesOrder
public void setOwnBuildTypesOrder(List<String> internalIds)
- Specified by:
setOwnBuildTypesOrder
in interfaceProjectEx
- Parameters:
internalIds
- Empty list will remove custom ordering
-
getOwnProjectsOrder
@NotNull public List<SProject> getOwnProjectsOrder()
Description copied from interface:ProjectEx
Unlike SProject.getOwnProjects() could return partial list of Projects (if custom ordering is partial)- Specified by:
getOwnProjectsOrder
in interfaceProjectEx
- Returns:
- List of Project ordered
-
getOwnBuildTypesOrder
@NotNull public List<SBuildType> getOwnBuildTypesOrder()
Description copied from interface:ProjectEx
Unlike SProject.getOwnBuildTypes() could return partial list of Build Types (if custom ordering is partial)- Specified by:
getOwnBuildTypesOrder
in interfaceProjectEx
- Returns:
- List of Build Types ordered
-
getArtifactDirectories
@NotNull public List<File> getArtifactDirectories()
- Specified by:
getArtifactDirectories
in 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:ProjectEx
Enables or disables editing of the project in web UI, see alsoSPersistentEntity.isReadOnly()
. Editing is enabled or disabled for the project itself and all nested entities unless it is overridden in the nested entity.SProject.persist()
method must be called afterwards.- Specified by:
setEditable
in interfaceProjectEx
- Parameters:
editable
- true to enable editing and false to disable
-
getOwnEnforcedSettings
@Nullable public ProjectEnforcedSettings getOwnEnforcedSettings()
- Specified by:
getOwnEnforcedSettings
in 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:
getEnforcedSettings
in 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:ProjectEx
Attach enforced settings profile to this project. Neither configurations nor templates nor subproject would be reloaded at this moment, however new enforced settings will be applied immediately (will be read at first access).
- Specified by:
setEnforcedSettings
in interfaceProjectEx
-
attachEnforcedSettings
public void attachEnforcedSettings(@NotNull BuildTypeTemplate typeTemplateEx)
- Specified by:
attachEnforcedSettings
in interfaceProjectEx
-
getNextAvailableFeatureId
@Nullable public String getNextAvailableFeatureId(@NotNull String type, @NotNull Map<String,String> params)
Description copied from interface:ProjectEx
Returns a generated ID that will be used by the next feature added to this project- Specified by:
getNextAvailableFeatureId
in 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:SProject
Adds new project feature.- Specified by:
addFeature
in 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:SProject
Adds new project feature with provided ID if auto-generated ID is not desirable- Specified by:
addFeature
in 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:SProject
Adds project feature. If the project feature doesn't belong to this project - a copy will be created.- Specified by:
addFeature
in interfaceSProject
- Parameters:
feature
- project feature to add
-
getOwnFeatures
@NotNull public Collection<SProjectFeatureDescriptor> getOwnFeatures()
- Specified by:
getOwnFeatures
in interfaceSProject
- Returns:
- own project features.
-
getOwnFeaturesOfType
@NotNull public Collection<SProjectFeatureDescriptor> getOwnFeaturesOfType(@NotNull String type)
- Specified by:
getOwnFeaturesOfType
in 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:
getAvailableFeaturesOfType
in 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:
getAvailableFeatures
in 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:SProject
Removes project feature with specified id.- Specified by:
removeFeature
in 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:SProject
Updates type and parameters of project feature with specified id.- Specified by:
updateFeature
in 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:SProject
Finds project feature by id.- Specified by:
findFeatureById
in interfaceSProject
- Parameters:
featureId
- feature id- Returns:
- found feature or null
-
isReadOnly
public boolean isReadOnly()
- Specified by:
isReadOnly
in interfaceSPersistentEntity
- Returns:
- true if this entity settings are in read only mode
-
getReadOnlyReason
@Nullable public ReadOnlyReason getReadOnlyReason()
- Specified by:
getReadOnlyReason
in 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:SProject
Returns 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:
isVirtual
in interfaceSPersistentEntity
- Specified by:
isVirtual
in interfaceSProject
- Returns:
- true if the project is virtual and false otherwise.
-
getAgentPools
public List<AgentPool> getAgentPools()
Description copied from interface:SProject
Return list of Agent Pool this project is associated with.- Specified by:
getAgentPools
in interfaceSProject
- Returns:
- see above
-
getEditableSettingsNote
@Nullable public String getEditableSettingsNote()
Description copied from interface:ProjectEx
Returns admin area header note text to be shown if this project is editable or null if no note should be shown- Specified by:
getEditableSettingsNote
in interfaceProjectEx
-
hasVersionedSettings
public boolean hasVersionedSettings()
Description copied from interface:ProjectEx
Returns true if this project stores its settings in VCS, false otherwise- Specified by:
hasVersionedSettings
in interfaceProjectEx
- Returns:
- see above
-
isExtIdChangeSupported
public boolean isExtIdChangeSupported()
Description copied from interface:ProjectEx
Returns true if extId can be changed in this project and all its entities- Specified by:
isExtIdChangeSupported
in interfaceProjectEx
- Returns:
- see above
-
isMoveEntitiesSupported
public boolean isMoveEntitiesSupported()
Description copied from interface:ProjectEx
Returns true if project settings format supports move of entities in projects hierarchy- Specified by:
isMoveEntitiesSupported
in interfaceProjectEx
- Returns:
- see above
-
isMoveSupported
public boolean isMoveSupported()
Description copied from interface:ProjectEx
Returns true if project settings format supports move of the project with all its entities in projects hierarchy- Specified by:
isMoveSupported
in interfaceProjectEx
- Returns:
- see above
-
isProjectCreateSupported
public boolean isProjectCreateSupported()
Description copied from interface:ProjectEx
Returns true if format supports new project creation- Specified by:
isProjectCreateSupported
in interfaceProjectEx
- Returns:
- see above
-
isProjectDeleteSupported
public boolean isProjectDeleteSupported()
Description copied from interface:ProjectEx
Returns true if project settings format supports delete of the project- Specified by:
isProjectDeleteSupported
in interfaceProjectEx
- Returns:
- see above
-
isDefaultBranchExcluded
public boolean isDefaultBranchExcluded()
Description copied from interface:ProjectEx
Returns true if all project's own buildTypes exclude the default branch. Returns false if project doesn't have own buildTypes.- Specified by:
isDefaultBranchExcluded
in interfaceProjectEx
- Returns:
- see above
-
getOwnParameter
public Parameter getOwnParameter(@NotNull String paramName)
- Specified by:
getOwnParameter
in 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:InheritableUserParametersHolderEx
Own should be last. Root should be first. Should not contain nulls or empty collections.
- Specified by:
getOwnAndParentsNonInheritedParameters
in interfaceInheritableUserParametersHolderEx
- Returns:
-
getOwnAndParentsNonInheritedParameter
@NotNull public List<Parameter> getOwnAndParentsNonInheritedParameter(@NotNull String paramName)
Description copied from interface:InheritableUserParametersHolderEx
Own should be last. Root should be first. Should not contain nulls.
- Specified by:
getOwnAndParentsNonInheritedParameter
in interfaceInheritableUserParametersHolderEx
- Returns:
-
getOwnParametersWithoutInheritedSpec
@NotNull public Collection<Parameter> getOwnParametersWithoutInheritedSpec()
- Specified by:
getOwnParametersWithoutInheritedSpec
in interfaceInheritableUserParametersHolder
- Returns:
- own parameters as is, with own parameters spec.
-
getInheritedParametersCollection
@NotNull public Collection<Parameter> getInheritedParametersCollection()
- Specified by:
getInheritedParametersCollection
in interfaceInheritableUserParametersHolder
- Returns:
- collection of inherited parameters.
-
getOwnNonInheritedParameter
@Nullable public Parameter getOwnNonInheritedParameter(@NotNull String paramName)
Description copied from interface:InheritableUserParametersHolderEx
Own parameter without inherited parameter spec.- Specified by:
getOwnNonInheritedParameter
in interfaceInheritableUserParametersHolderEx
- Returns:
-
getOrCreateToken
@NotNull public String getOrCreateToken(@NotNull String secret, @NotNull String contextDescription)
Description copied from interface:SecureTokensProducer
For a specified secret (password, API key, etc) creates a token which can be used in project settings instead. Token and secret are persisted in the internal storage, next time when this method is called for the same secret, the same token is returned.- Specified by:
getOrCreateToken
in interfaceSecureTokensProducer
- 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:
getTokenContext
in 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:SecureDataStorage
Returns 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:
getSecureValue
in 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:
getTokensWithoutSecret
in 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:
getCredentialsStorageType
in interfaceProjectEx
- Returns:
- name of currently used credentials storage, or null if project does not use any storage
-
getCredentialsStorage
@Nullable public CredentialsStorage getCredentialsStorage()
- Specified by:
getCredentialsStorage
in 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:
getVersionedSettingsVcsRoot
in interfaceProjectEx
-
getEffectiveGenerator
@Nullable public ProjectSettingsGenerator getEffectiveGenerator()
Description copied from interface:ProjectEx
Same asVersionedSettingsManager.getEffectiveGenerator(SProject)
, but returns null if generator is not found instead of throwing an error- Specified by:
getEffectiveGenerator
in interfaceProjectEx
-
hasSettingsWithSecureValues
public boolean hasSettingsWithSecureValues()
- Specified by:
hasSettingsWithSecureValues
in 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:SPersistentEntity
Returns version of this entity which can be used to check if the entity was edited or persisted.- Specified by:
getVersion
in interfaceSPersistentEntity
- Returns:
- see above
-
markPersisted
public void markPersisted(long expectedEditId)
Description copied from interface:SPersistentEntity
Marks entity as persisted- Specified by:
markPersisted
in 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:SProject
Returns a custom data storage for the given storage id associated with this project- Specified by:
getCustomDataStorage
in interfaceSProject
- Parameters:
storageId
- storage id of interest- Returns:
- see above
-
saveSettingsBranchSpec
public boolean saveSettingsBranchSpec(@NotNull VcsRootInstance root, @NotNull BranchSpec spec)
Description copied from interface:ProjectEx
Updates 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:
saveSettingsBranchSpec
in 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:ProjectEx
Returns 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:
getSettingsRootSpec
in interfaceProjectEx
- Returns:
- see above
-
findPluginSettings
@Nullable public File findPluginSettings(@NotNull String pluginName, @NotNull String fileNme)
Description copied from interface:ProjectEx
Search 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:
findPluginSettings
in interfaceProjectEx
- Parameters:
pluginName
- the name of the pluginfileNme
- settings file name to search- Returns:
- settings file if found,
null
otherwise
-
isEmptyUuid
public boolean isEmptyUuid()
- Specified by:
isEmptyUuid
in 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:ProjectEx
Initializes project's archived flag. Should be used only when creating a project.- Specified by:
initArchivedStatus
in interfaceProjectEx
- Parameters:
archived
- archived flag
-
getParametersSupport
@NotNull public ContainerWithInherited<String,Parameter> getParametersSupport()
- Specified by:
getParametersSupport
in interfaceParameterSupport
- Specified by:
getParametersSupport
in interfaceProjectEx
-
createConfigAction
@NotNull public ConfigActionEx createConfigAction(@Nullable SUser user, @NotNull String description)
Description copied from interface:SPersistentEntity
Creates 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:
createConfigAction
in interfaceProjectEx
- Specified by:
createConfigAction
in 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:
getVirtualBuildTypes
in interfaceProjectEx
-
-