Class InaccessibleTemplate
- java.lang.Object
-
- jetbrains.buildServer.serverSide.impl.InaccessibleTemplate
-
- All Implemented Interfaces:
Comparable<BuildTypeTemplate>
,BuildTypeIdentity
,BuildTypeIdentityEx
,BuildTypeOptions
,BuildTypeOwnSettings
,BuildTypeSettings
,BuildTypeSettingsEx
,BuildTypeTemplate
,BuildTypeTemplateEx
,CleanupSettings
,CleanupSettingsInit
,CompatibleAgents
,DependencySettings
,Dependent
,BuildTypeSettingsSupport
,ParameterSupport
,InheritableUserParametersHolder
,InheritableUserParametersHolderEx
,InternalParameters
,ParametersSupport
,ReadOnlyUserParameters
,SPersistentEntity
,UserParametersHolder
,VcsLabelingSettings
,OptionSupport
public class InaccessibleTemplate extends Object implements BuildTypeTemplateEx, BuildTypeSettingsEx
Wrapper object used in the case when template became inaccessible to current user (either template was deleted or template is from the project to which user does not have permissions)
-
-
Nested Class Summary
-
Nested classes/interfaces inherited from interface jetbrains.buildServer.serverSide.BuildTypeOptions
BuildTypeOptions.BuildConfigurationType
-
Nested classes/interfaces inherited from interface jetbrains.buildServer.serverSide.vcs.VcsLabelingSettings
VcsLabelingSettings.LabelingType
-
-
Field Summary
Fields Modifier and Type Field Description static InaccessibleTemplate
INSTANCE
-
Fields inherited from interface jetbrains.buildServer.serverSide.BuildTypeOptions
BT_ALLOW_EXTERNAL_STATUS, BT_ALLOW_PERSONAL_BUILD_TRIGGERING, BT_ARTIFACT_PUBLISH_CONDITION, BT_ARTIFACT_RULES, BT_BRANCH_FILTER, BT_BUILD_CONFIGURATION_TYPE, BT_BUILD_DEFAULT_BRANCH, BT_BUILD_NUMBER_PATTERN, BT_CHECKOUT_DIR, BT_CHECKOUT_MODE, BT_CLEAN_BUILD, BT_EXCLUDE_DEFAULT_BRANCH_CHANGES, BT_EXECUTION_TIMEOUT, BT_FAIL_IF_TESTS_FAIL, BT_FAIL_ON_ANY_ERROR_MESSAGE, BT_FAIL_ON_EXIT_CODE, BT_FAIL_ON_OOME_OR_CRASH, BT_GENERATED_SETTINGS_CHECKSUM, BT_HANGING_BUILDS_DETECTION_ENABLED, BT_MAX_RUNNING_BUILDS, BT_MAX_RUNNING_BUILDS_PER_BRANCH, BT_SHOW_DEPS_CHANGES, BT_SUPPORT_TEST_RETRY, DEFAULT_BUILD_NUMBER_PATTERN, DEFAULT_MAX_RUNNING_BUILDS_PER_BRANCH, DEFAULT_VCS_LABELING_BRANCH_FILTER, VCS_LABELING_BRANCH_FILTER
-
Fields inherited from interface jetbrains.buildServer.serverSide.CleanupSettings
CLEANUP_PREVENT_DEPENDENCIES_ARTIFACTS_FROM_CLEANUP, DISABLE_CLEANUP_POLICIES
-
Fields inherited from interface jetbrains.buildServer.serverSide.vcs.VcsLabelingSettings
DEFAULT_LABEL_PATTERN
-
-
Method Summary
All Methods Instance Methods Concrete Methods Deprecated Methods Modifier and Type Method Description void
addArtifactDependency(SArtifactDependency dependency)
Adds artifact dependency.SBuildFeatureDescriptor
addBuildFeature(String type, Map<String,String> params)
Adds build feature with specified type and parameters to this settings object.void
addBuildFeature(SBuildFeatureDescriptor feature)
Adds build feature descriptor to this settings object.void
addBuildParameter(Parameter parameter)
Adds build parameter to the configuration.SBuildRunnerDescriptor
addBuildRunner(String id, String name, String runnerType, Map<String,String> parameters)
Creates a new build runner with the specified id, name, runner type, and parameters, and adds it to the current build settings.SBuildRunnerDescriptor
addBuildRunner(String name, String runnerType, Map<String,String> parameters)
Creates new build runner and adds it to these settings.SBuildRunnerDescriptor
addBuildRunner(BuildRunnerDescriptor runner)
Adds runner descriptor.BuildTriggerDescriptor
addBuildTrigger(String type, Map<String,String> params)
Adds new trigger of specified type and with specified parameters to build configuration settings.boolean
addBuildTrigger(BuildTriggerDescriptor triggerDescriptor)
Adds new trigger to build configuration settings.void
addCleanupPolicy(HistoryRetentionPolicy policy)
Sets cleanup policy for this build configurationvoid
addConfigParameter(Parameter param)
Adds configuration parameter.void
addDependency(Dependency dependOn)
Add dependency on another build configurationvoid
addListener(BuildTypeSettingsListener listener)
void
addListener(BuildTypeSettingsListener listener, boolean delayPropagation)
Adds listener to the build type settings and all settings of the attached templatesvoid
addParameter(Parameter param)
Adds parameter.void
addRequirement(Requirement requirement)
Adds new build requirement to the configuration.void
addRunParameter(SBuildRunnerDescriptor runner, Parameter parameter)
boolean
addVcsRoot(SVcsRoot root)
Adds VCS root to the build configuration with default checkout rules.void
applyRunnersOrder(String[] ids)
Changes order of build runners in this template and in all of the inherited build configurations.void
applyRunnersOrder(String[] ids, boolean alwaysSetCustom)
Apply custom order of build stepsvoid
attachedToModel(ProjectDataModel model)
boolean
belongsTo(SProject project)
Checks whether this build type or template belongs to the specified project or one of its subprojects, transitively.int
compareTo(BuildTypeTemplate o)
boolean
containsOwnVcsRoot(long vcsRootId)
Returns true if VCS root with specified id is attached directly and is not inherited via a templateboolean
containsVcsRoot(long vcsRootId)
Returns true if VCS root with specified id is attached directly or is inherited via a templatevoid
copyAllSettings(BuildTypeSettingsEx source)
Copies all settings, the behaviour is the same as copySettings with empty copyOptions, i.e.void
copyOverridableSettings(BuildTypeSettingsEx settingsSource)
void
copyOwnSettings(BuildTypeSettingsEx settings)
void
copySettings(BuildTypeSettingsEx source, BuildTypeCopySettings copyOptions)
Copies settings, parameters, options etc.ConfigAction
createConfigAction(SUser user, String description)
Creates a config action instance associated with this entity and having the specified description.BuildTypeSettingsEx
createCopy()
BuildPromotion
createDummyBuildPromotion()
BuildTypeTemplateEx
createEditableCopy(boolean fillSettings)
ParametersProvider
createParametersProvider(SBuild build)
ReadOnlyBuildTypeSettings
createReadOnlySettings()
void
dispose()
SBuildFeatureDescriptor
findBuildFeatureById(String featureId)
Returns build feature with specified idSBuildRunnerDescriptor
findBuildRunnerById(String runnerId)
Finds build runner by its' idSBuildRunnerDescriptor
findBuildRunnerByType(String runnerType)
Finds build runner by its' type.String
findRunnerParameter(String paramName)
Searches runner parameter in all build runners and returns value of the first found parameter with given name.BuildTriggerDescriptor
findTriggerById(String triggerId)
Finds build trigger descriptor by its' idCompatibilityResult
getAgentCompatibility(AgentDescription agentDescription)
Fetches compatibility information for given agent descriptionCollection<SBuildType>
getAllUsages()
Same as #getUsages() but also returns configurations that use this template as default templateList<SArtifactDependency>
getArtifactDependencies()
Returns artifacts this build configuration depending on.String
getArtifactPaths()
Returns build artifact paths.BranchSpec
getBranchSpec(SVcsRoot root)
Returns branch specification for specified parent rootList<Requirement>
getBuildFeatureRequirements()
Returns list of additional agent requirements imposed by configured enabled build features.List<SBuildFeatureDescriptor>
getBuildFeatures()
Returns build features added to this settings object.Collection<SBuildFeatureDescriptor>
getBuildFeaturesOfType(String type)
Returns all build features of specified type.ContainerWithDisabled<String,SBuildFeatureDescriptor>
getBuildFeatureSupport()
String
getBuildNumberPattern()
Returns current build number patternString
getBuildParameter(String key)
Returns build parameter by parameter keyMap<String,String>
getBuildParameters()
Return map of build parameters specified by user.Collection<Parameter>
getBuildParametersCollection()
Returns build parameters collection.List<SBuildRunnerDescriptor>
getBuildRunners()
Returns collection of build runners attached to these settingsContainerWithDisabled<String,SBuildRunnerDescriptor>
getBuildRunnerSupport()
BuildSettings
getBuildSettings()
Collection<BuildTriggerDescriptor>
getBuildTriggersCollection()
Returns collection of build trigger settingsContainerWithDisabled<String,BuildTriggerDescriptor>
getBuildTriggersSupport()
BranchFilter
getBuildTypeBranchFilter(ValueResolver valueResolver)
BranchFilter
getBuildTypeBranchFilterUnsafe(ValueResolver valueResolver)
Same asBuildTypeSettingsEx.getBuildTypeBranchFilter(ValueResolver)
but throws an exception if the filter is incorrectOption[]
getChangedOptions()
Return options with changed values, i.e.String
getCheckoutDirectory()
Returns build checkout directory - if specified explicitly usingBuildTypeSettings.setCheckoutDirectory(String)
.CheckoutRules
getCheckoutRules(VcsRoot root)
Returns checkout rules configured for the specified VCS root.BuildTypeDescriptor.CheckoutType
getCheckoutType()
Returns method used by agent to retrieve project sources.Collection<SBuildType>
getChildDependencies()
Returns all child dependencies collected down the chain.Map<String,Boolean>
getCleanupOptions()
Collection<HistoryRetentionPolicy>
getCleanupPolicies()
Map<SBuildAgent,CompatibilityResult>
getCompatibilityMap()
Returns compatibility map, key is an agent and value is compatibility result.Collection<SBuildAgent>
getCompatibleAgents()
Returns collection of compatible agentsString
getConfigId()
Returns the entity's config identifier.Map<String,String>
getConfigParameters()
Returns map of configuration parametersCollection<Parameter>
getConfigParametersCollection()
Returns collection of configuration parameters.File
getConfigurationFile()
Returns the configuration file where this build type or template is persisted (or will be persisted to).File
getConfigurationFile(File projectsDir)
Returns the configuration file where this entity is persisted in custom projects directoryList<Dependency>
getDependencies()
Get existing dependencies, empty collection when no dependencies existDependencyOptions
getDependencyOptions(SBuildType buildType)
String
getDescription()
Collection<String>
getDisabledParameterDescriptorIds()
Container<String,Boolean>
getDisabledState()
EntityId<String>
getEntityId()
Returns the instance of the entity identifier.String
getExternalId()
Returns the external identifier.String
getFullName()
Name of the project and name of the identity.String
getId()
Returns the internal identifier (that is used inside the database).List<Requirement>
getImplicitRequirements()
Get list of non-satisfied implicit requirements for build agents.Map<String,Boolean>
getInheritedCleanupOptions()
Collection<HistoryRetentionPolicy>
getInheritedCleanupPolicies()
Collection<Parameter>
getInheritedParametersCollection()
String
getInternalId()
Returns the internal identifier.List<VcsRoot>
getLabelingRoots()
List of roots which should be processed by labeling processVcsLabelingSettings.LabelingType
getLabelingType()
String
getLabelPattern()
AuditLogAction
getLastConfigModificationAction()
String
getName()
The name of the identity.int
getNumberOfUsages()
Returns total number of this template usages (without permissions filtering) in build configurationsint
getNumberOfUsagesAsDefaultTemplate()
Returns total number of projects (without permissions filtering) using this template as a default templateint
getNumberOfUsagesAsEnforcedSettings()
<T> T
getOption(Option<T> option)
Get option value<T> T
getOptionDefaultValue(Option<T> option)
Collection<Option>
getOptions()
ContainerWithInherited<Option<Object>,OptionValue<Object>>
getOptionSupport()
List<SArtifactDependency>
getOwnArtifactDependencies()
List<SBuildFeatureDescriptor>
getOwnBuildFeatures()
List<SBuildRunnerDescriptor>
getOwnBuildRunners()
List<BuildTriggerDescriptor>
getOwnBuildTriggers()
Map<String,Boolean>
getOwnCleanupOptions()
Collection<HistoryRetentionPolicy>
getOwnCleanupPolicies()
CleanupSettingsSupport
getOwnCleanupSupport()
List<Dependency>
getOwnDependencies()
Collection<String>
getOwnDisabledParameterDescriptorIds()
Parameter
getOwnNonInheritedParameter(String paramName)
Own parameter without inherited parameter spec.Collection<Option>
getOwnOptions()
Return options defined in this object, i.e.OptionSupportEx
getOwnOptionSupport()
Parameter
getOwnParameter(String paramName)
Map<String,String>
getOwnParameters()
Collection<Parameter>
getOwnParametersCollection()
Collection<Parameter>
getOwnParametersWithoutInheritedSpec()
List<Requirement>
getOwnRequirements()
Collection<String>
getOwnRunnerTypes()
SerializableParametersCollection
getOwnSerializableParameters()
List<String>
getOwnTemplateExternalIds()
List<String>
getOwnTemplateIds()
List<BuildTypeTemplateEx>
getOwnTemplates()
List<VcsRootEntry>
getOwnVcsRootEntries()
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 project to which this template belongsString
getParentProjectId()
Returns id of the project to which this template belongsProjectEx
getProject()
Returns the project this build type entity belongs to.String
getProjectId()
Returns internal id of the project to which this template belongsReadOnlyReason
getReadOnlyReason()
List<Requirement>
getRequirements()
Get list of explicit requirements for build agents which can run this build configuration.ContainerWithDisabled<String,Requirement>
getRequirementSupport()
BuildStepConditions
getRunnerConditions(SBuildRunnerDescriptor descriptor)
String[]
getRunnersOrder()
Collection<String>
getRunnerTypes()
Returns types of the runners attached to these settingsList<Requirement>
getRunTypeRequirements()
Returns list of additional agent requirements imposed by configured runners.SecureDataStorage
getSecureDataStorage()
BuildTypeSettingsEx
getSettings()
BuildTypeTemplateEx
getTemplate()
Returns the first template these settings are based on.String
getTemplateExternalId()
Deprecated.String
getTemplateId()
Returns internal id of the first template this setting is based onList<String>
getTemplateIds()
Returns internal ids of the templates this settings are based on, including one of the default templateList<BuildTypeTemplateEx>
getTemplates()
Returns templates these settings are based on, including the default template.List<String>
getUndefinedParameters()
Returns collection of parameter names (config and build params) referenced in the build configuration settings but without values provided.Collection<SBuildType>
getUsages()
Returns collection of build configurations attached to this template.Collection<SProject>
getUsagesAsDefaultTemplate()
Returns collection of projects where this template is used as a default template.Collection<SProject>
getUsagesAsEnforcedSettings()
ValueResolver
getValueResolver()
Returns value resolver which can be used to resolve references in valuesList<Branch>
getVcsBranches(boolean includeDependenciesBranches)
All VCS branches from VCS roots attached to this template and VCS branches from dependencies (if parameter includeDependenciesBranches is true).List<VcsRootEntry>
getVcsRootEntries()
Returns all entries of vcs roots.List<VcsRootInstanceEntry>
getVcsRootInstanceEntries()
List<SVcsRoot>
getVcsRoots()
Returns all roots currently attached to this configurationPersistentEntityVersion
getVersion()
Returns version of this entity which can be used to check if the entity was edited or persisted.BuildTypeTemplateEx
inline()
Creates a temporary copy of this template with all settings inherited from a project or a template inlined.boolean
intersectsWith(Dependent dependent)
Returns true if this object dependencies intersect (have same nodes) with specified object dependencies.boolean
isAccessibleFrom(SProject project)
Returns true if this template is accessible from specified project, i.e.boolean
isAgentLessBuildType()
boolean
isBranchSpecDefined(boolean processDependencies)
boolean
isCompositeBuildType()
boolean
isDefaultBranchExcluded()
Returns true if any of VCS roots attached to configuration exclude the default branchboolean
isDeployment()
boolean
isDeploymentBuildType()
boolean
isEmptyUuid()
boolean
isEnabled(String id)
Returns true if descriptor with specified id (runner, trigger or build feature) is enabled and false otherwise.boolean
isReadOnly()
boolean
isTemplateAccessible()
Checks accessibility of all attached templates, excluding the default template (if present)boolean
isTemplateBased()
Returns true if these settings are directly based on a template.void
markPersisted(long expectedEditId)
Marks entity as persistedvoid
moveToProject(ConfigAction cause, SProject target)
Moves this template to the specified project.void
moveToProject(SProject target)
Moves this template to the specified project.void
persist()
Persists this entity instance onto disk.void
persist(ConfigAction cause)
Persists this entity on disk.void
remove()
Removes this entity.void
removeAllBuildRunners()
Removes all build runners from these settingsvoid
removeArtifactDependency(SArtifactDependency dependency)
Removes artifact dependency.SBuildFeatureDescriptor
removeBuildFeature(String featureId)
Removes build feature with specified id from this settings object.void
removeBuildParameter(String paramName)
Removes existing build parameter by its name.SBuildRunnerDescriptor
removeBuildRunner(String runnerId)
Removes runner descriptor with specified id.boolean
removeBuildTrigger(BuildTriggerDescriptor triggerDescriptor)
Removes specified build trigger from the settingsvoid
removeCleanupPolicies()
Remove all own cleanup policies for the objectvoid
removeConfigParameter(String paramName)
Removes configuration parameters with specified nameboolean
removeDependency(Dependency dependOn)
Remove dependency on another build configurationvoid
removeListener(BuildTypeSettingsListener listener)
void
removeParameter(String paramName)
Removes parameter.void
removeRequirement(String propertyName)
Removes first requirement with the specified property name from the configuration.void
removeRequirement(Requirement requirement)
Removes a requirement from the configuration.boolean
removeVcsRoot(SVcsRoot root)
Removes existing VCS root from the build configuration.void
replaceDependency(SArtifactDependency origDep, SArtifactDependency newDep)
Replaces original dependency object with another onevoid
replaceDependency(Dependency origDep, Dependency newDep)
Replaces original dependency object with another oneboolean
replaceInValues(String regexp, String replacement)
Replaces values according to specified regexp and replacement string in all text parameters of the build configurationboolean
replaceInValues(Pattern regexpPattern, String replacement)
Replaces values according to specified pattern and replacement string in all text parameters of the build configurationboolean
replaceVcsRoot(SVcsRoot oldVcsRoot, SVcsRoot newVcsRoot)
Replaces existing VCS root entry in settings with a new one, maintaining the order of the root entriesvoid
resetRunnersOrder()
Resets custom runner order to default.PersistTask
schedulePersisting(String reason)
Schedules background persisting of this entity settings.PersistTask
schedulePersisting(ConfigAction cause)
Schedules background persisting of this project settings.PersistTask
scheduleRemove(ConfigAction cause)
Schedules remove of this persistent entity.void
sendExtIdChangedEvents(ConfigAction cause, String oldExternalId, String newExternalId)
This method can be used to send external id changed event.void
setArtifactDependencies(List<SArtifactDependency> artifacts)
Sets artifacts this build configuration depending on.void
setArtifactPaths(String artifactPaths)
Sets build artifact paths.void
setBuildNumberPattern(String pattern)
Sets build number pattern.void
setCheckoutDirectory(String dir)
Sets build checkout directory.boolean
setCheckoutRules(VcsRoot root, CheckoutRules checkoutRules)
Sets checkout rules for specified VCS root.void
setCheckoutType(BuildTypeDescriptor.CheckoutType type)
Sets preferred checkout type for the configuration sources.void
setCleanupOption(String option, Boolean value)
Sets value for a cleanup optionvoid
setDescription(String description)
Sets template descriptionvoid
setEditable(boolean editable)
Enables or disables editing of the template in web UI, see alsoSPersistentEntity.isReadOnly()
.void
setEnabled(String id, boolean enabled)
Enables or disables descriptor with specified id in build configuration settings.void
setExternalId(String externalId)
Changes the external id of this build template or build configuration.void
setExternalId(ConfigAction cause, String newExternalId)
Changes the external id of this build template or build configuration.void
setExternalId(ConfigAction configAction, String newId, boolean sendEvents)
Same as {BuildTypeIdentity.setExternalId(ConfigAction, String)
} but provides control over events processing.void
setName(String name)
Sets name of this build type or template<T> void
setOption(Option<T> option, T value)
Set option value, clears value if it is the same as defaultvoid
setParametersSupport(ParametersSupport paramsSupport)
void
setProject(ProjectEx project)
Sets new project to settings objectvoid
setSecureDataStorage(SecureDataStorage secureDataStorage)
Sets secure data storage to be used by these settings when they are persisted on disk.void
setTemplateIds(List<String> templateIds)
Change which templates these settings are attached to.void
setTemplatesOrder(List<String> templateIds)
Imposes new order on the associated templates.boolean
setVcsRoots(Collection<SVcsRoot> vcsRoots)
Sets VCS roots.boolean
textValueMatches(Pattern regexpPattern)
Returns true if configuration has value in text parameters which matches specified pattern.void
unregister()
Removes this object from project model.boolean
updateBuildFeature(String featureId, String newType, Map<String,String> newParams)
Updates build feature descriptor with specified id, changes type and parameters.boolean
updateBuildRunner(String runnerId, String name, String type, Map<String,String> params)
Updates parameters in the existing build runner descriptor.boolean
updateBuildTrigger(String triggerId, String newType, Map<String,String> newParams)
Updates build trigger descriptor with specified id, changes type and parameters.boolean
updateBuildTrigger(BuildTriggerDescriptor newDescriptor)
Updates build trigger descriptor with id equal to newDescriptor id.boolean
vcsRootsAccessibleInProject(SProject project)
-
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
-
Methods inherited from interface jetbrains.buildServer.serverSide.BuildTypeSettingsEx
getDeclaredOption, getParameterDescriptorState, getTypedOption
-
Methods inherited from interface jetbrains.buildServer.serverSide.InheritableUserParametersHolderEx
getOwnAndParentsNonInheritedParameter, getOwnAndParentsNonInheritedParameters
-
Methods inherited from interface jetbrains.buildServer.serverSide.InternalParameters
getBooleanInternalParameter, getBooleanInternalParameterOrTrue, getInternalParameterValue
-
Methods inherited from interface jetbrains.buildServer.serverSide.SPersistentEntity
isVirtual
-
-
-
-
Field Detail
-
INSTANCE
public static final InaccessibleTemplate INSTANCE
-
-
Method Detail
-
getProject
@NotNull public ProjectEx getProject()
Description copied from interface:BuildTypeIdentity
Returns the project this build type entity belongs to.- Specified by:
getProject
in interfaceBuildTypeIdentity
- Specified by:
getProject
in interfaceBuildTypeSettings
- Specified by:
getProject
in interfaceBuildTypeSettingsEx
- Specified by:
getProject
in interfaceBuildTypeTemplate
- Specified by:
getProject
in interfaceBuildTypeTemplateEx
- Returns:
- the project this build type entity belongs to.
-
setProject
public void setProject(@NotNull ProjectEx project)
Description copied from interface:BuildTypeSettingsEx
Sets new project to settings object- Specified by:
setProject
in interfaceBuildTypeSettingsEx
-
getParent
@Nullable public SPersistentEntity getParent()
Description copied from interface:SPersistentEntity
The parent entity.- Specified by:
getParent
in interfaceSPersistentEntity
- Returns:
- see above.
-
getSettings
@NotNull public BuildTypeSettingsEx getSettings()
- Specified by:
getSettings
in interfaceBuildTypeIdentityEx
- Specified by:
getSettings
in interfaceBuildTypeTemplateEx
- Returns:
- Underlying build settings object
-
getEntityId
@NotNull public EntityId<String> getEntityId()
Description copied from interface:BuildTypeIdentityEx
Returns the instance of the entity identifier.This instance (not a copy!) that contains immutable internal id and modifiable external id. When one has changed the external id of this build template or configuration, the external id incide this class instance will be changed too.
- Specified by:
getEntityId
in interfaceBuildTypeIdentityEx
- Returns:
- the instance of the entity identifier.
-
getId
@NotNull public String getId()
Description copied from interface:BuildTypeTemplate
Returns the internal identifier (that is used inside the database).- Specified by:
getId
in interfaceBuildTypeTemplate
- Returns:
- the internal identifier.
- See Also:
BuildTypeIdentity.getExternalId()
-
getDescription
@NotNull public String getDescription()
- Specified by:
getDescription
in interfaceBuildTypeTemplate
- Returns:
- template description
-
setDescription
public void setDescription(@NotNull String description)
Description copied from interface:BuildTypeTemplate
Sets template description- Specified by:
setDescription
in interfaceBuildTypeTemplate
- Parameters:
description
- template description
-
getInternalId
@NotNull public String getInternalId()
Description copied from interface:BuildTypeIdentity
Returns the internal identifier.- Specified by:
getInternalId
in interfaceBuildTypeIdentity
- Returns:
- the internal identifier.
-
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:BuildTypeIdentity
Returns the external identifier.- Specified by:
getExternalId
in interfaceBuildTypeIdentity
- Specified by:
getExternalId
in interfaceSPersistentEntity
- Returns:
- the external identifier.
-
getName
@NotNull public String getName()
Description copied from interface:BuildTypeIdentity
The name of the identity.- Specified by:
getName
in interfaceBuildTypeIdentity
- Specified by:
getName
in interfaceSPersistentEntity
- Returns:
- see above.
- See Also:
BuildTypeIdentity.getFullName()
,BuildTypeIdentity.setName(String)
-
getFullName
@NotNull public String getFullName()
Description copied from interface:BuildTypeIdentity
Name of the project and name of the identity.- Specified by:
getFullName
in interfaceBuildTypeIdentity
- See Also:
BuildTypeIdentity.getName()
-
setName
public void setName(@NotNull String name)
Description copied from interface:BuildTypeIdentity
Sets name of this build type or template- Specified by:
setName
in interfaceBuildTypeIdentity
- Parameters:
name
- the new name- See Also:
BuildTypeIdentity.getName()
,BuildTypeIdentity.getFullName()
-
persist
public void persist()
Description copied from interface:SPersistentEntity
Persists this entity instance onto disk. Should be called each time when settings are changed, otherwise the changes will be lost after the server restart.- Specified by:
persist
in interfaceBuildTypeSettings
- Specified by:
persist
in interfaceBuildTypeTemplate
- Specified by:
persist
in interfaceSPersistentEntity
-
persist
public void persist(@NotNull ConfigAction cause) throws PersistFailedException
Description copied from interface:SPersistentEntity
Persists this entity on disk.- Specified by:
persist
in interfaceBuildTypeSettings
- Specified by:
persist
in interfaceSPersistentEntity
- Parameters:
cause
- an action which caused persisting- Throws:
PersistFailedException
- if persisting failed
-
schedulePersisting
@NotNull public PersistTask 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)
-
schedulePersisting
@NotNull public PersistTask 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)
-
scheduleRemove
@NotNull public PersistTask scheduleRemove(@NotNull ConfigAction cause) throws PersistFailedException
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
- Throws:
PersistFailedException
- if failed to schedule the operation
-
getUsages
public Collection<SBuildType> getUsages()
Description copied from interface:BuildTypeTemplate
Returns collection of build configurations attached to this template. This does not include the build configurations that use this template because it is defined as default template in the respective projects- Specified by:
getUsages
in interfaceBuildTypeTemplate
- Returns:
- see above.
-
getAllUsages
public Collection<SBuildType> getAllUsages()
Description copied from interface:BuildTypeTemplate
Same as #getUsages() but also returns configurations that use this template as default template- Specified by:
getAllUsages
in interfaceBuildTypeTemplate
- Returns:
- see above
-
getUsagesAsDefaultTemplate
public Collection<SProject> getUsagesAsDefaultTemplate()
Description copied from interface:BuildTypeTemplate
Returns collection of projects where this template is used as a default template. This does not include projects that use it as a default template because it is set up as such in one of the higher level projects in their paths- Specified by:
getUsagesAsDefaultTemplate
in interfaceBuildTypeTemplate
- Returns:
- see above
-
getUsagesAsEnforcedSettings
public Collection<SProject> getUsagesAsEnforcedSettings()
- Specified by:
getUsagesAsEnforcedSettings
in interfaceBuildTypeTemplateEx
- Returns:
- a collection of projects that use the template to represent their enforced settings
-
getNumberOfUsages
public int getNumberOfUsages()
Description copied from interface:BuildTypeTemplate
Returns total number of this template usages (without permissions filtering) in build configurations- Specified by:
getNumberOfUsages
in interfaceBuildTypeTemplate
- Returns:
- see above
-
getNumberOfUsagesAsDefaultTemplate
public int getNumberOfUsagesAsDefaultTemplate()
Description copied from interface:BuildTypeTemplate
Returns total number of projects (without permissions filtering) using this template as a default template- Specified by:
getNumberOfUsagesAsDefaultTemplate
in interfaceBuildTypeTemplate
- Returns:
- see above
-
getNumberOfUsagesAsEnforcedSettings
public int getNumberOfUsagesAsEnforcedSettings()
- Specified by:
getNumberOfUsagesAsEnforcedSettings
in interfaceBuildTypeTemplateEx
- Returns:
- a number of projects that use the template to represent their enforced settings
-
containsOwnVcsRoot
public boolean containsOwnVcsRoot(long vcsRootId)
Description copied from interface:BuildTypeSettings
Returns true if VCS root with specified id is attached directly and is not inherited via a template- Specified by:
containsOwnVcsRoot
in interfaceBuildTypeSettings
- Specified by:
containsOwnVcsRoot
in interfaceBuildTypeTemplateEx
- Parameters:
vcsRootId
- vcs root id- Returns:
- true if the specified VCS root is attached to the temlate directly and is not inherited
-
createDummyBuildPromotion
public BuildPromotion createDummyBuildPromotion()
- Specified by:
createDummyBuildPromotion
in interfaceBuildTypeTemplateEx
- Returns:
- dummy build promotion
-
createEditableCopy
public BuildTypeTemplateEx createEditableCopy(boolean fillSettings)
- Specified by:
createEditableCopy
in interfaceBuildTypeTemplateEx
-
moveToProject
public void moveToProject(@NotNull SProject target)
Description copied from interface:BuildTypeTemplate
Moves this template to the specified project. Note that if there are local VCS roots attached to this template, they will be shared. If sharing is impossible due to lack of access rights, AccessDeniedException will be thrown.- Specified by:
moveToProject
in interfaceBuildTypeTemplate
- Parameters:
target
- target project
-
moveToProject
public void moveToProject(@NotNull ConfigAction cause, @NotNull SProject target) throws InvalidVcsRootScopeException, TemplateBecomesInaccessibleException
Description copied from interface:BuildTypeTemplate
Moves this template to the specified project. Note that if there are local VCS roots attached to this template, they will be shared. If sharing is impossible due to lack of access rights, AccessDeniedException will be thrown.- Specified by:
moveToProject
in interfaceBuildTypeTemplate
- Parameters:
cause
- config action caused the changetarget
- target project- Throws:
InvalidVcsRootScopeException
- if VCS roots used by this template will not be accessible in the target projectTemplateBecomesInaccessibleException
- if template is used by configurations and won't be available for them if it is moved to target project
-
getRunnerTypes
@NotNull public Collection<String> getRunnerTypes()
Description copied from interface:BuildTypeSettings
Returns types of the runners attached to these settings- Specified by:
getRunnerTypes
in interfaceBuildTypeSettings
- Returns:
- see above
-
getOwnRunnerTypes
@NotNull public Collection<String> getOwnRunnerTypes()
- Specified by:
getOwnRunnerTypes
in interfaceBuildTypeOwnSettings
-
getBuildParameters
@NotNull public Map<String,String> getBuildParameters()
Description copied from interface:BuildTypeSettings
Return map of build parameters specified by user. Each build parameter has name and value. Name of each parameter starts from a prefix: env. or system. Value may by either simple string, or may contain references to other parameters in form %env.HOME% or %system.os.name% or %system.agent.name%- Specified by:
getBuildParameters
in interfaceBuildTypeSettings
- Returns:
- see above
-
getBuildParametersCollection
@NotNull public Collection<Parameter> getBuildParametersCollection()
Description copied from interface:BuildTypeSettings
Returns build parameters collection.- Specified by:
getBuildParametersCollection
in interfaceBuildTypeSettings
- Returns:
- see above
-
addBuildParameter
public void addBuildParameter(Parameter parameter)
Description copied from interface:BuildTypeSettings
Adds build parameter to the configuration. Build parameter is a system or environment variable. Concrete parameter type is being selected by its name prefix.Constants.SYSTEM_PREFIX
for system properties andConstants.ENV_PREFIX
for environment variable.- Specified by:
addBuildParameter
in interfaceBuildTypeSettings
- Parameters:
parameter
- specified parameter.
-
removeBuildParameter
public void removeBuildParameter(String paramName)
Description copied from interface:BuildTypeSettings
Removes existing build parameter by its name.- Specified by:
removeBuildParameter
in interfaceBuildTypeSettings
- Parameters:
paramName
- specified parameter name.
-
getBuildParameter
public String getBuildParameter(String key)
Description copied from interface:BuildTypeSettings
Returns build parameter by parameter key- Specified by:
getBuildParameter
in interfaceBuildTypeSettings
- Parameters:
key
- parameter key- Returns:
- build parameter by parameter key
-
getVcsRoots
@NotNull public List<SVcsRoot> getVcsRoots()
Description copied from interface:BuildTypeSettings
Returns all roots currently attached to this configuration- Specified by:
getVcsRoots
in interfaceBuildTypeSettings
- Returns:
- collection of all attached vcs roots.
-
addBuildTrigger
public boolean addBuildTrigger(@NotNull BuildTriggerDescriptor triggerDescriptor)
Description copied from interface:BuildTypeSettings
Adds new trigger to build configuration settings. UseBuildTriggerDescriptorFactory
to create trigger descriptor.- Specified by:
addBuildTrigger
in interfaceBuildTypeSettings
- Parameters:
triggerDescriptor
- trigger descriptor- Returns:
- true if trigger was added, and false if trigger with such id already exists
-
addBuildTrigger
@NotNull public BuildTriggerDescriptor addBuildTrigger(@NotNull String type, @NotNull Map<String,String> params)
Description copied from interface:BuildTypeSettings
Adds new trigger of specified type and with specified parameters to build configuration settings.- Specified by:
addBuildTrigger
in interfaceBuildTypeSettings
- Parameters:
type
- type of the triggerparams
- parameters map- Returns:
- newly created trigger descriptor
-
removeBuildTrigger
public boolean removeBuildTrigger(@NotNull BuildTriggerDescriptor triggerDescriptor)
Description copied from interface:BuildTypeSettings
Removes specified build trigger from the settings- Specified by:
removeBuildTrigger
in interfaceBuildTypeSettings
- Parameters:
triggerDescriptor
- trigger descriptor- Returns:
- true if trigger was actually removed and false otherwise
-
updateBuildTrigger
public boolean updateBuildTrigger(@NotNull String triggerId, @NotNull String newType, @NotNull Map<String,String> newParams)
Description copied from interface:BuildTypeSettings
Updates build trigger descriptor with specified id, changes type and parameters.- Specified by:
updateBuildTrigger
in interfaceBuildTypeSettings
- Parameters:
triggerId
- id of build trigger descriptornewType
- type of build trigger descriptornewParams
- parameters map- Returns:
- true if parameters of build trigger descriptor were changed (descriptor with such id exists) and false otherwise
-
updateBuildTrigger
public boolean updateBuildTrigger(@NotNull BuildTriggerDescriptor newDescriptor)
Description copied from interface:BuildTypeSettings
Updates build trigger descriptor with id equal to newDescriptor id.- Specified by:
updateBuildTrigger
in interfaceBuildTypeSettings
- Parameters:
newDescriptor
- new settings of the trigger- Returns:
- true if parameters of build trigger descriptor were changed (descriptor with such id exists) and false otherwise
-
getBuildTriggersCollection
@NotNull public Collection<BuildTriggerDescriptor> getBuildTriggersCollection()
Description copied from interface:BuildTypeSettings
Returns collection of build trigger settings- Specified by:
getBuildTriggersCollection
in interfaceBuildTypeSettings
- Returns:
- see above
-
findTriggerById
public BuildTriggerDescriptor findTriggerById(@NotNull String triggerId)
Description copied from interface:BuildTypeSettings
Finds build trigger descriptor by its' id- Specified by:
findTriggerById
in interfaceBuildTypeSettings
- Parameters:
triggerId
- id of the trigger- Returns:
- build trigger descriptor or null if trigger with such id not found
-
setCheckoutType
public void setCheckoutType(BuildTypeDescriptor.CheckoutType type)
Description copied from interface:BuildTypeSettings
Sets preferred checkout type for the configuration sources. Actual checkout type may differ, for example, if preferred checkout type is set to ON_AGENT, but there is vcs root which does not support on agent checkout, actual checkout type will be switched to ON_SERVER.BuildTypeDescriptor.CheckoutType.ON_SERVER
- checkout sources automatically on the server and snd it to the agent.BuildTypeDescriptor.CheckoutType.ON_AGENT
- checkout sources automatically on the agent.BuildTypeDescriptor.CheckoutType.MANUAL
- do not check out sources automatically.- Specified by:
setCheckoutType
in interfaceBuildTypeSettings
- Parameters:
type
- new checkout type.
-
getCheckoutType
@NotNull public BuildTypeDescriptor.CheckoutType getCheckoutType()
Description copied from interface:BuildTypeSettings
Returns method used by agent to retrieve project sources. CheckoutType.ON_SERVER server creates patch and sends it to agent CheckoutType.ON_AGENT agent checks sources out CheckoutType.MANUAL script does it itself. This method returns actual checkout type, which may differ from the value set byBuildTypeSettings.setCheckoutType(jetbrains.buildServer.BuildTypeDescriptor.CheckoutType)
- Specified by:
getCheckoutType
in interfaceBuildTypeSettings
- Returns:
- method to get sources on agent.
-
setCheckoutDirectory
public void setCheckoutDirectory(@Nullable String dir)
Description copied from interface:BuildTypeSettings
Sets build checkout directory. Set it to null to use default checkout directory.- Specified by:
setCheckoutDirectory
in interfaceBuildTypeSettings
- Parameters:
dir
- checkout directory
-
getCheckoutDirectory
public String getCheckoutDirectory()
Description copied from interface:BuildTypeSettings
Returns build checkout directory - if specified explicitly using
BuildTypeSettings.setCheckoutDirectory(String)
. Returnsnull
if default checkout directory, generated by TeamCity should be used.- Specified by:
getCheckoutDirectory
in interfaceBuildTypeSettings
- Returns:
- build checkout directory.
- See Also:
BuildTypeSettings.setCheckoutDirectory(String)
-
setArtifactPaths
public void setArtifactPaths(@Nullable String artifactPaths)
Description copied from interface:BuildTypeSettings
Sets build artifact paths. Artifact paths are comma separated paths to build artifacts. Support ant-style wildcards and target directories like *.zip => winFiles,unix/dist.tgz => linuxFiles, where winFiles and linuxFiles are target directories. Set to null or empty string to disable artifacts processing.- Specified by:
setArtifactPaths
in interfaceBuildTypeSettings
- Parameters:
artifactPaths
- paths to build artifacts
-
getArtifactPaths
public String getArtifactPaths()
Description copied from interface:BuildTypeSettings
Returns build artifact paths.- Specified by:
getArtifactPaths
in interfaceBuildTypeSettings
- Returns:
- build artifact paths
-
getArtifactDependencies
@NotNull public List<SArtifactDependency> getArtifactDependencies()
Description copied from interface:BuildTypeSettings
Returns artifacts this build configuration depending on.- Specified by:
getArtifactDependencies
in interfaceBuildTypeSettings
- Returns:
- list of artifacts this build configuration depending on
-
setArtifactDependencies
public void setArtifactDependencies(@NotNull List<SArtifactDependency> artifacts)
Description copied from interface:BuildTypeSettings
Sets artifacts this build configuration depending on.- Specified by:
setArtifactDependencies
in interfaceBuildTypeSettings
- Parameters:
artifacts
- new artifacts dependency list.
-
addArtifactDependency
public void addArtifactDependency(@NotNull SArtifactDependency dependency)
Description copied from interface:BuildTypeSettings
Adds artifact dependency.- Specified by:
addArtifactDependency
in interfaceBuildTypeSettings
- Parameters:
dependency
- new artifact dependency
-
removeArtifactDependency
public void removeArtifactDependency(@NotNull SArtifactDependency dependency)
Description copied from interface:BuildTypeSettings
Removes artifact dependency.- Specified by:
removeArtifactDependency
in interfaceBuildTypeSettings
- Parameters:
dependency
- artifact dependency
-
containsVcsRoot
public boolean containsVcsRoot(long vcsRootId)
Description copied from interface:BuildTypeSettings
Returns true if VCS root with specified id is attached directly or is inherited via a template- Specified by:
containsVcsRoot
in interfaceBuildTypeSettings
- Parameters:
vcsRootId
- id of VCS root- Returns:
- see above
-
getVcsRootEntries
@NotNull public List<VcsRootEntry> getVcsRootEntries()
Description copied from interface:BuildTypeSettings
Returns all entries of vcs roots. Each entry contains reference to root and its checkout rules.- Specified by:
getVcsRootEntries
in interfaceBuildTypeSettings
- Returns:
- all entries of vcs roots for this configuration
-
addVcsRoot
public boolean addVcsRoot(@NotNull SVcsRoot root) throws InvalidVcsRootScopeException, VcsRootNotFoundException
Description copied from interface:BuildTypeSettings
Adds VCS root to the build configuration with default checkout rules.- Specified by:
addVcsRoot
in interfaceBuildTypeSettings
- Parameters:
root
- VCS root to add- Returns:
- true if VCS root was actually added and false otherwise (this VCS root already exists)
- Throws:
InvalidVcsRootScopeException
- if VCS root scope is local and corresponds to another project (not the project - owner of this build configuration)VcsRootNotFoundException
- if specified VCS root does not exist anymore
-
replaceVcsRoot
public boolean replaceVcsRoot(@NotNull SVcsRoot oldVcsRoot, @NotNull SVcsRoot newVcsRoot)
Description copied from interface:BuildTypeTemplateEx
Replaces existing VCS root entry in settings with a new one, maintaining the order of the root entries- Specified by:
replaceVcsRoot
in interfaceBuildTypeSettingsEx
- Specified by:
replaceVcsRoot
in interfaceBuildTypeTemplateEx
- Parameters:
oldVcsRoot
- VCS root to be replacednewVcsRoot
- VCS root to insert instead- Returns:
- true if VCS root was actually replaced, false otherwise (the root to be replaced did not exist or the new root already existed)
-
setVcsRoots
public boolean setVcsRoots(@NotNull Collection<SVcsRoot> vcsRoots)
Description copied from interface:BuildTypeTemplateEx
Sets VCS roots. All existing VCS roots that are not present in vcsRoots are deleted, all other existing VCS roots are reordered if necessary, but retain their original checkout rules.- Specified by:
setVcsRoots
in interfaceBuildTypeSettingsEx
- Specified by:
setVcsRoots
in interfaceBuildTypeTemplateEx
- Returns:
- true if any changes occured
-
setSecureDataStorage
public void setSecureDataStorage(@NotNull SecureDataStorage secureDataStorage)
Description copied from interface:BuildTypeSettingsEx
Sets secure data storage to be used by these settings when they are persisted on disk.- Specified by:
setSecureDataStorage
in interfaceBuildTypeSettingsEx
- Parameters:
secureDataStorage
- secure data storage
-
getSecureDataStorage
@NotNull public SecureDataStorage getSecureDataStorage()
- Specified by:
getSecureDataStorage
in interfaceBuildTypeSettingsEx
- Returns:
- secure data storage used by these settings
-
getDependencyOptions
@Nullable public DependencyOptions getDependencyOptions(@NotNull SBuildType buildType)
- Specified by:
getDependencyOptions
in interfaceBuildTypeSettingsEx
- Parameters:
buildType
- build type- Returns:
- dependency options instance if current settings instance has snapshot dependency on specified build type or null
-
getBuildTypeBranchFilter
@NotNull public BranchFilter getBuildTypeBranchFilter(@NotNull ValueResolver valueResolver)
- Specified by:
getBuildTypeBranchFilter
in interfaceBuildTypeSettingsEx
- Parameters:
valueResolver
- value resolver- Returns:
- branch filter which is used to filter branches available in this build type
-
getBuildTypeBranchFilterUnsafe
public BranchFilter getBuildTypeBranchFilterUnsafe(@NotNull ValueResolver valueResolver) throws InvalidBranchSpecException
Description copied from interface:BuildTypeSettingsEx
Same asBuildTypeSettingsEx.getBuildTypeBranchFilter(ValueResolver)
but throws an exception if the filter is incorrect- Specified by:
getBuildTypeBranchFilterUnsafe
in interfaceBuildTypeSettingsEx
- Throws:
InvalidBranchSpecException
-
setEditable
public void setEditable(boolean editable)
Description copied from interface:BuildTypeTemplateEx
Enables or disables editing of the template in web UI, see alsoSPersistentEntity.isReadOnly()
.SBuildType.persist()
method must be called afterwards.- Specified by:
setEditable
in interfaceBuildTypeTemplateEx
- Parameters:
editable
- true to enable editing and false to disable
-
vcsRootsAccessibleInProject
public boolean vcsRootsAccessibleInProject(@NotNull SProject project)
- Specified by:
vcsRootsAccessibleInProject
in interfaceBuildTypeSettingsEx
-
createReadOnlySettings
@NotNull public ReadOnlyBuildTypeSettings createReadOnlySettings()
- Specified by:
createReadOnlySettings
in interfaceBuildTypeSettingsEx
-
createCopy
@NotNull public BuildTypeSettingsEx createCopy()
- Specified by:
createCopy
in interfaceBuildTypeSettingsEx
-
replaceDependency
public void replaceDependency(@NotNull Dependency origDep, @NotNull Dependency newDep)
Description copied from interface:BuildTypeSettingsEx
Replaces original dependency object with another one- Specified by:
replaceDependency
in interfaceBuildTypeSettingsEx
-
replaceDependency
public void replaceDependency(@NotNull SArtifactDependency origDep, @NotNull SArtifactDependency newDep)
Description copied from interface:BuildTypeSettingsEx
Replaces original dependency object with another one- Specified by:
replaceDependency
in interfaceBuildTypeSettingsEx
-
getOptions
@NotNull public Collection<Option> getOptions()
- Specified by:
getOptions
in interfaceOptionSupport
- Returns:
- combined set of options - own and inherited
-
removeVcsRoot
public boolean removeVcsRoot(@NotNull SVcsRoot root)
Description copied from interface:BuildTypeSettings
Removes existing VCS root from the build configuration. If there were checkout rules attached to this VCS root they will be removed too.- Specified by:
removeVcsRoot
in interfaceBuildTypeSettings
- Parameters:
root
- VCS root to remove- Returns:
- true if VCS root was actually removed from the build configuration and false if build configuration did not have this vcs root attached
-
setCheckoutRules
public boolean setCheckoutRules(@NotNull VcsRoot root, @NotNull CheckoutRules checkoutRules)
Description copied from interface:BuildTypeSettings
Sets checkout rules for specified VCS root. VCS root must be attached to this build configuration.- Specified by:
setCheckoutRules
in interfaceBuildTypeSettings
- Parameters:
root
- root to set rules forcheckoutRules
- checkout rules for the VCS root- Returns:
- true if checkout rules were set for the VCS root (if VCS root is attached) and false otherwise
-
getCheckoutRules
public CheckoutRules getCheckoutRules(@NotNull VcsRoot root)
Description copied from interface:BuildTypeSettings
Returns checkout rules configured for the specified VCS root. If specified VCS root is not attached to this build configuration, then null is returned.- Specified by:
getCheckoutRules
in interfaceBuildTypeSettings
- Parameters:
root
- VCS root- Returns:
- checkout rules or null if specified VCS root is not attached to the build configuration
-
textValueMatches
public boolean textValueMatches(@NotNull Pattern regexpPattern)
Description copied from interface:BuildTypeSettings
Returns true if configuration has value in text parameters which matches specified pattern. Only own parameters are checked - without inherited- Specified by:
textValueMatches
in interfaceBuildTypeSettings
- Parameters:
regexpPattern
- regexp pattern- Returns:
- true if such value exists and false otherwise
-
getLabelingType
@NotNull public VcsLabelingSettings.LabelingType getLabelingType()
- Specified by:
getLabelingType
in interfaceVcsLabelingSettings
- Returns:
- Returns labeling mode
-
getLabelPattern
@NotNull public String getLabelPattern()
- Specified by:
getLabelPattern
in interfaceVcsLabelingSettings
- Returns:
- Returns pattern to use for labeling
-
getLabelingRoots
@NotNull public List<VcsRoot> getLabelingRoots()
Description copied from interface:VcsLabelingSettings
List of roots which should be processed by labeling process- Specified by:
getLabelingRoots
in interfaceVcsLabelingSettings
- Returns:
- list of up-to-date vcs roots
-
addConfigParameter
public void addConfigParameter(@NotNull Parameter param)
Description copied from interface:BuildTypeSettings
Adds configuration parameter. There are three different types of parameters which can be added to build configuration settings:- build parameters - these are parameters passed to agent and then to a build (see
BuildTypeSettings.addBuildParameter(Parameter)
), these parameters must have prefix system. or env. - runner parameters - these are parameters of a runner, they are transferred to agent and passed to corresponding build runner plugin
- configuration parameters - these parameters are not transferred to agent or build, but can be referenced in various places (including build & runner parameters and thus can effectively pass to a build)
- Specified by:
addConfigParameter
in interfaceBuildTypeSettings
- Parameters:
param
- configuration parameter
- build parameters - these are parameters passed to agent and then to a build (see
-
removeConfigParameter
public void removeConfigParameter(@NotNull String paramName)
Description copied from interface:BuildTypeSettings
Removes configuration parameters with specified name- Specified by:
removeConfigParameter
in interfaceBuildTypeSettings
- Parameters:
paramName
- parameter name
-
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).
-
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).
-
getConfigParametersCollection
@NotNull public Collection<Parameter> getConfigParametersCollection()
Description copied from interface:BuildTypeSettings
Returns collection of configuration parameters.- Specified by:
getConfigParametersCollection
in interfaceBuildTypeSettings
- Returns:
- see above
-
getConfigParameters
@NotNull public Map<String,String> getConfigParameters()
Description copied from interface:BuildTypeSettings
Returns map of configuration parameters- Specified by:
getConfigParameters
in interfaceBuildTypeSettings
- Returns:
- see above
-
getUndefinedParameters
@NotNull public List<String> getUndefinedParameters()
Description copied from interface:BuildTypeSettings
Returns collection of parameter names (config and build params) referenced in the build configuration settings but without values provided. I.e. there is a reference to a parameter but such parameter is not defined anywhere.
Parameter value can come from different sources:- build configuration or template settings
- agents
- various extensions
- Specified by:
getUndefinedParameters
in interfaceBuildTypeSettings
- Returns:
- see above
-
isTemplateBased
public boolean isTemplateBased()
Description copied from interface:BuildTypeSettings
Returns true if these settings are directly based on a template. It does not take into account a default template.- Specified by:
isTemplateBased
in interfaceBuildTypeOwnSettings
- Specified by:
isTemplateBased
in interfaceBuildTypeSettings
- Returns:
- see above
-
getTemplateIds
@NotNull public List<String> getTemplateIds()
Description copied from interface:BuildTypeSettings
Returns internal ids of the templates this settings are based on, including one of the default template- Specified by:
getTemplateIds
in interfaceBuildTypeSettings
- Returns:
- see above
-
getTemplateId
public String getTemplateId()
Description copied from interface:BuildTypeSettings
Returns internal id of the first template this setting is based on- Specified by:
getTemplateId
in interfaceBuildTypeSettings
- Returns:
- see above
-
getRunTypeRequirements
@NotNull public List<Requirement> getRunTypeRequirements()
Description copied from interface:BuildTypeSettings
Returns list of additional agent requirements imposed by configured runners.- Specified by:
getRunTypeRequirements
in interfaceBuildTypeSettings
- Returns:
- see above
-
getBuildFeatureRequirements
@NotNull public List<Requirement> getBuildFeatureRequirements()
Description copied from interface:BuildTypeSettings
Returns list of additional agent requirements imposed by configured enabled build features.- Specified by:
getBuildFeatureRequirements
in interfaceBuildTypeSettings
- Returns:
- see above
-
addBuildRunner
@NotNull public SBuildRunnerDescriptor addBuildRunner(@NotNull BuildRunnerDescriptor runner)
Description copied from interface:BuildTypeSettings
Adds runner descriptor. UseBuildRunnerDescriptorFactory
to create instance of runner descriptor.
Before 8.0 this method requiredSBuildRunnerDescriptor
as parameter- Specified by:
addBuildRunner
in interfaceBuildTypeSettings
- Parameters:
runner
- descriptor- Returns:
- instance of actually added runner
-
addBuildRunner
@NotNull public SBuildRunnerDescriptor addBuildRunner(@NotNull String name, @NotNull String runnerType, @NotNull Map<String,String> parameters)
Description copied from interface:BuildTypeSettings
Creates new build runner and adds it to these settings. Runner's ID is autogenerated- Specified by:
addBuildRunner
in interfaceBuildTypeSettings
- Parameters:
name
- runner namerunnerType
- type of the runnerparameters
- runner parameters- Returns:
- newly created runner
-
addBuildRunner
@NotNull public SBuildRunnerDescriptor addBuildRunner(@NotNull String id, @NotNull String name, @NotNull String runnerType, @NotNull Map<String,String> parameters) throws DuplicateIdException, InvalidIdentifierException, ReadOnlyEntityException
Description copied from interface:BuildTypeSettings
Creates a new build runner with the specified id, name, runner type, and parameters, and adds it to the current build settings.- Specified by:
addBuildRunner
in interfaceBuildTypeSettings
- Parameters:
id
- the unique id of the build runner (should be unique within all runners of this configuration)name
- the name of the build runnerrunnerType
- the type of the build runnerparameters
- the parameters for the build runner- Returns:
- the newly created build runner descriptor
- Throws:
DuplicateIdException
- if the id is already in use by another build runner, runners inherited from templates are not consideredInvalidIdentifierException
- if the id is invalid or emptyReadOnlyEntityException
- if the settings are read-only and cannot be modified
-
removeBuildRunner
public SBuildRunnerDescriptor removeBuildRunner(@NotNull String runnerId)
Description copied from interface:BuildTypeSettings
Removes runner descriptor with specified id.- Specified by:
removeBuildRunner
in interfaceBuildTypeSettings
- Parameters:
runnerId
- descriptor id- Returns:
- removed runner descriptor
-
updateBuildRunner
public boolean updateBuildRunner(@NotNull String runnerId, @NotNull String name, @NotNull String type, @NotNull Map<String,String> params)
Description copied from interface:BuildTypeSettings
Updates parameters in the existing build runner descriptor. Does nothing if there runner with specified id was not found.- Specified by:
updateBuildRunner
in interfaceBuildTypeSettings
- Parameters:
runnerId
- id of runner descriptorname
- new runner nametype
- new type of the runnerparams
- new runner parameters- Returns:
- true if parameters updated and false otherwise
-
getBuildRunners
@NotNull public List<SBuildRunnerDescriptor> getBuildRunners()
Description copied from interface:BuildTypeSettings
Returns collection of build runners attached to these settings- Specified by:
getBuildRunners
in interfaceBuildTypeSettings
- Returns:
- see above
-
removeAllBuildRunners
public void removeAllBuildRunners()
Description copied from interface:BuildTypeSettings
Removes all build runners from these settings- Specified by:
removeAllBuildRunners
in interfaceBuildTypeSettings
-
applyRunnersOrder
public void applyRunnersOrder(@NotNull String[] ids)
Description copied from interface:BuildTypeTemplate
Changes order of build runners in this template and in all of the inherited build configurations. Note that after that persist operation invoked on the template will also persist inherited build configurations.- Specified by:
applyRunnersOrder
in interfaceBuildTypeSettings
- Specified by:
applyRunnersOrder
in interfaceBuildTypeTemplate
- Parameters:
ids
- runner identifiers
-
resetRunnersOrder
public void resetRunnersOrder()
Description copied from interface:BuildTypeSettings
Resets custom runner order to default.- Specified by:
resetRunnersOrder
in interfaceBuildTypeSettings
-
findBuildRunnerByType
public SBuildRunnerDescriptor findBuildRunnerByType(@NotNull String runnerType)
Description copied from interface:BuildTypeSettings
Finds build runner by its' type. If there is more than one build runner, returns the first one.- Specified by:
findBuildRunnerByType
in interfaceBuildTypeSettings
- Parameters:
runnerType
- type of the runner- Returns:
- build runner or null if runner was not found
-
findBuildRunnerById
public SBuildRunnerDescriptor findBuildRunnerById(@NotNull String runnerId)
Description copied from interface:BuildTypeSettings
Finds build runner by its' id- Specified by:
findBuildRunnerById
in interfaceBuildTypeSettings
- Parameters:
runnerId
- id of the runner- Returns:
- build runner or null if runner with such id not found
-
findRunnerParameter
public String findRunnerParameter(@NotNull String paramName)
Description copied from interface:BuildTypeSettings
Searches runner parameter in all build runners and returns value of the first found parameter with given name.- Specified by:
findRunnerParameter
in interfaceBuildTypeSettings
- Parameters:
paramName
- name of the parameter- Returns:
- the first found parameter value or null
-
getRequirements
@NotNull public List<Requirement> getRequirements()
Description copied from interface:BuildTypeSettings
Get list of explicit requirements for build agents which can run this build configuration. Explicit requirements are specified by user in Web UI explicitly.- Specified by:
getRequirements
in interfaceBuildTypeSettings
- Returns:
- see above
-
getImplicitRequirements
@NotNull public List<Requirement> getImplicitRequirements()
Description copied from interface:BuildTypeSettings
Get list of non-satisfied implicit requirements for build agents. Implicit requirements appear when some build configuration property, or run parameter contains a reference to another parameter in form %<param name>%.- Specified by:
getImplicitRequirements
in interfaceBuildTypeSettings
- Returns:
- see above
-
addRequirement
public void addRequirement(@NotNull Requirement requirement)
Description copied from interface:BuildTypeSettings
Adds new build requirement to the configuration. If the requirement has no id, then a copy of it with new id is generated and added to the settings.- Specified by:
addRequirement
in interfaceBuildTypeSettings
- Parameters:
requirement
- new requirement.
-
removeRequirement
public void removeRequirement(String propertyName)
Description copied from interface:BuildTypeSettings
Removes first requirement with the specified property name from the configuration.- Specified by:
removeRequirement
in interfaceBuildTypeSettings
- Parameters:
propertyName
- name of the requirement parameter.
-
removeRequirement
public void removeRequirement(Requirement requirement)
Description copied from interface:BuildTypeSettings
Removes a requirement from the configuration.- Specified by:
removeRequirement
in interfaceBuildTypeSettings
- Parameters:
requirement
- requirement to be removed
-
getBuildNumberPattern
@NotNull public String getBuildNumberPattern()
Description copied from interface:BuildTypeSettings
Returns current build number pattern- Specified by:
getBuildNumberPattern
in interfaceBuildTypeSettings
- Returns:
- see above
-
setBuildNumberPattern
public void setBuildNumberPattern(@NotNull String pattern)
Description copied from interface:BuildTypeSettings
Sets build number pattern. %build.counter% in the pattern will be replaced with current build number value when build starts- Specified by:
setBuildNumberPattern
in interfaceBuildTypeSettings
- Parameters:
pattern
- pattern to set
-
setParametersSupport
public void setParametersSupport(@NotNull ParametersSupport paramsSupport)
- Specified by:
setParametersSupport
in interfaceBuildTypeSettingsEx
-
copySettings
public void copySettings(@NotNull BuildTypeSettingsEx source, @NotNull BuildTypeCopySettings copyOptions)
Description copied from interface:BuildTypeSettingsEx
Copies settings, parameters, options etc. from another instance of build type settings.- Specified by:
copySettings
in interfaceBuildTypeSettingsEx
- Parameters:
source
- source settingscopyOptions
- copy options; if empty, the method regenerates setting ids for the settings that clash by ids with the inherited ones in the destination, and copies disabled and inherited settings from the source- See Also:
BuildTypeSettingsCopyOptions
-
copyAllSettings
public void copyAllSettings(@NotNull BuildTypeSettingsEx source)
Description copied from interface:BuildTypeSettingsEx
Copies all settings, the behaviour is the same as copySettings with empty copyOptions, i.e. it regenerates setting ids for the settings that clash by ids with the inherited ones in the destination, and copies disabled and inherited settings from the source.- Specified by:
copyAllSettings
in interfaceBuildTypeSettingsEx
-
copyOwnSettings
public void copyOwnSettings(@NotNull BuildTypeSettingsEx settings)
- Specified by:
copyOwnSettings
in interfaceBuildTypeSettingsEx
-
copyOverridableSettings
public void copyOverridableSettings(@NotNull BuildTypeSettingsEx settingsSource)
- Specified by:
copyOverridableSettings
in interfaceBuildTypeSettingsEx
-
addListener
public void addListener(@NotNull BuildTypeSettingsListener listener)
- Specified by:
addListener
in interfaceBuildTypeSettingsEx
-
addListener
public void addListener(@NotNull BuildTypeSettingsListener listener, boolean delayPropagation)
Description copied from interface:BuildTypeSettingsEx
Adds listener to the build type settings and all settings of the attached templates- Specified by:
addListener
in interfaceBuildTypeSettingsEx
- Parameters:
listener
- ListenerdelayPropagation
- If true, attaching of the listener to a template is delayed until attachedToModel is called
-
removeListener
public void removeListener(@NotNull BuildTypeSettingsListener listener)
- Specified by:
removeListener
in interfaceBuildTypeSettingsEx
-
getTemplate
public BuildTypeTemplateEx getTemplate()
Description copied from interface:BuildTypeSettings
Returns the first template these settings are based on.- Specified by:
getTemplate
in interfaceBuildTypeSettings
- Specified by:
getTemplate
in interfaceBuildTypeSettingsEx
- Returns:
- see above
-
getTemplates
@NotNull public List<BuildTypeTemplateEx> getTemplates()
Description copied from interface:BuildTypeSettings
Returns templates these settings are based on, including the default template.- Specified by:
getTemplates
in interfaceBuildTypeSettings
- Specified by:
getTemplates
in interfaceBuildTypeSettingsEx
- Returns:
- see above
-
getOwnTemplates
@NotNull public List<BuildTypeTemplateEx> getOwnTemplates()
- Specified by:
getOwnTemplates
in interfaceBuildTypeOwnSettings
-
createParametersProvider
public ParametersProvider createParametersProvider(@NotNull SBuild build)
- Specified by:
createParametersProvider
in interfaceBuildTypeSettingsEx
-
applyRunnersOrder
public void applyRunnersOrder(@NotNull String[] ids, boolean alwaysSetCustom)
Description copied from interface:BuildTypeSettingsEx
Apply custom order of build steps- Specified by:
applyRunnersOrder
in interfaceBuildTypeSettingsEx
- Parameters:
ids
- the order defined by build step idsalwaysSetCustom
- if true, the build configuration stores the new order as a custom order even if there are no templates attached
-
attachedToModel
public void attachedToModel(@NotNull ProjectDataModel model)
- Specified by:
attachedToModel
in interfaceBuildTypeSettingsEx
-
dispose
public void dispose()
- Specified by:
dispose
in interfaceBuildTypeSettingsEx
- Specified by:
dispose
in interfaceBuildTypeTemplateEx
-
getConfigurationFile
@NotNull public File getConfigurationFile()
Description copied from interface:BuildTypeIdentity
Returns the configuration file where this build type or template is persisted (or will be persisted to).- Specified by:
getConfigurationFile
in interfaceBuildTypeIdentity
- Specified by:
getConfigurationFile
in interfaceSPersistentEntity
- Returns:
- see above.
-
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
-
isTemplateAccessible
public boolean isTemplateAccessible()
Description copied from interface:BuildTypeSettings
Checks accessibility of all attached templates, excluding the default template (if present)- Specified by:
isTemplateAccessible
in interfaceBuildTypeSettings
- Returns:
- true if there are such templates and all of them are accessible to currently logged in user, false otherwise
-
getOwnDependencies
@NotNull public List<Dependency> getOwnDependencies()
- Specified by:
getOwnDependencies
in interfaceBuildTypeOwnSettings
-
getOwnVcsRootEntries
@NotNull public List<VcsRootEntry> getOwnVcsRootEntries()
- Specified by:
getOwnVcsRootEntries
in interfaceBuildTypeOwnSettings
-
addRunParameter
public void addRunParameter(@NotNull SBuildRunnerDescriptor runner, @NotNull Parameter parameter)
- Specified by:
addRunParameter
in interfaceBuildTypeSettingsEx
-
getOwnDisabledParameterDescriptorIds
@NotNull public Collection<String> getOwnDisabledParameterDescriptorIds()
- Specified by:
getOwnDisabledParameterDescriptorIds
in interfaceBuildTypeOwnSettings
-
getDisabledParameterDescriptorIds
@NotNull public Collection<String> getDisabledParameterDescriptorIds()
- Specified by:
getDisabledParameterDescriptorIds
in interfaceBuildTypeSettingsEx
-
getBuildSettings
@NotNull public BuildSettings getBuildSettings()
- Specified by:
getBuildSettings
in interfaceBuildTypeSettingsEx
- Specified by:
getBuildSettings
in interfaceBuildTypeTemplateEx
-
isBranchSpecDefined
public boolean isBranchSpecDefined(boolean processDependencies)
- Specified by:
isBranchSpecDefined
in interfaceBuildTypeTemplateEx
-
getVcsBranches
@NotNull public List<Branch> getVcsBranches(boolean includeDependenciesBranches)
Description copied from interface:BuildTypeTemplateEx
All VCS branches from VCS roots attached to this template and VCS branches from dependencies (if parameter includeDependenciesBranches is true).- Specified by:
getVcsBranches
in interfaceBuildTypeTemplateEx
- Parameters:
includeDependenciesBranches
- whether to add branches from dependencies to the list or not- Returns:
- see above
-
replaceInValues
public boolean replaceInValues(@NotNull String regexp, @NotNull String replacement) throws PatternSyntaxException
Description copied from interface:BuildTypeSettings
Replaces values according to specified regexp and replacement string in all text parameters of the build configuration- Specified by:
replaceInValues
in interfaceBuildTypeSettings
- Parameters:
regexp
- regexpreplacement
- replacement- Returns:
- true if at least one text value was affected and false otherwise
- Throws:
PatternSyntaxException
- if pattern is incorrect
-
replaceInValues
public boolean replaceInValues(@NotNull Pattern regexpPattern, @NotNull String replacement)
Description copied from interface:BuildTypeSettings
Replaces values according to specified pattern and replacement string in all text parameters of the build configuration- Specified by:
replaceInValues
in interfaceBuildTypeSettings
- Parameters:
regexpPattern
- regexp patternreplacement
- replacement- Returns:
- true if at least one text value was affected and false otherwise
-
addBuildFeature
@NotNull public SBuildFeatureDescriptor addBuildFeature(@NotNull String type, @NotNull Map<String,String> params)
Description copied from interface:BuildTypeSettings
Adds build feature with specified type and parameters to this settings object.- Specified by:
addBuildFeature
in interfaceBuildTypeSettings
- Parameters:
type
- build feature typeparams
- build feature parameters- Returns:
- build feature descriptor
-
addBuildFeature
public void addBuildFeature(@NotNull SBuildFeatureDescriptor feature)
Description copied from interface:BuildTypeSettings
Adds build feature descriptor to this settings object.- Specified by:
addBuildFeature
in interfaceBuildTypeSettings
- Parameters:
feature
- build feature descriptor
-
getBuildFeatures
@NotNull public List<SBuildFeatureDescriptor> getBuildFeatures()
Description copied from interface:BuildTypeSettings
Returns build features added to this settings object.- Specified by:
getBuildFeatures
in interfaceBuildTypeSettings
- Returns:
- collection of configured build features
-
getBuildFeaturesOfType
@NotNull public Collection<SBuildFeatureDescriptor> getBuildFeaturesOfType(@NotNull String type)
Description copied from interface:BuildTypeSettings
Returns all build features of specified type.- Specified by:
getBuildFeaturesOfType
in interfaceBuildTypeSettings
- Returns:
- see above
-
removeBuildFeature
public SBuildFeatureDescriptor removeBuildFeature(@NotNull String featureId)
Description copied from interface:BuildTypeSettings
Removes build feature with specified id from this settings object.- Specified by:
removeBuildFeature
in interfaceBuildTypeSettings
- Parameters:
featureId
- id of the feature- Returns:
- removed build feature descriptor or null if there were no feature descriptor with such id
-
updateBuildFeature
public boolean updateBuildFeature(@NotNull String featureId, @NotNull String newType, @NotNull Map<String,String> newParams)
Description copied from interface:BuildTypeSettings
Updates build feature descriptor with specified id, changes type and parameters.- Specified by:
updateBuildFeature
in interfaceBuildTypeSettings
- Parameters:
featureId
- id of build feature descriptornewType
- type of build feature descriptornewParams
- parameters map- Returns:
- true if parameters of build feature descriptor were changed (descriptor with such id exists) and false otherwise
-
findBuildFeatureById
@Nullable public SBuildFeatureDescriptor findBuildFeatureById(@NotNull String featureId)
Description copied from interface:BuildTypeSettings
Returns build feature with specified id- Specified by:
findBuildFeatureById
in interfaceBuildTypeSettings
- Parameters:
featureId
- id of the feature- Returns:
- see above
-
setEnabled
public void setEnabled(@NotNull String id, boolean enabled)
Description copied from interface:BuildTypeSettings
Enables or disables descriptor with specified id in build configuration settings. This method can be used to enable or disable build runners, triggers and build features.- Specified by:
setEnabled
in interfaceBuildTypeSettings
- Parameters:
id
- id of build runner, trigger or build featureenabled
- true to enable, false to disable
-
isEnabled
public boolean isEnabled(@NotNull String id)
Description copied from interface:BuildTypeSettings
Returns true if descriptor with specified id (runner, trigger or build feature) is enabled and false otherwise.- Specified by:
isEnabled
in interfaceBuildTypeSettings
- Parameters:
id
- id of build runner, trigger or build feature
-
isDeployment
public boolean isDeployment()
- Specified by:
isDeployment
in interfaceBuildTypeSettings
- Returns:
- true if this build configuration is doing deployment
-
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
-
setExternalId
public void setExternalId(@NotNull String externalId) throws InvalidIdentifierException, DuplicateExternalIdException
Description copied from interface:BuildTypeIdentity
Changes the external id of this build template or build configuration.This method persists the current entity, and can persist also dependent entities.
- Specified by:
setExternalId
in interfaceBuildTypeIdentity
- Parameters:
externalId
- new external identifier. Must be unique (case insensitively) in the scope of all build templates and build configurations (in other words, two projects with build configurations with same external id are not allowed).- Throws:
InvalidIdentifierException
- wrong identifierDuplicateExternalIdException
- a build template or a build configuration
-
setExternalId
public void setExternalId(@NotNull ConfigAction cause, @NotNull String newExternalId) throws InvalidIdentifierException, DuplicateExternalIdException
Description copied from interface:BuildTypeIdentity
Changes the external id of this build template or build configuration.This method persists the current entity, and can persist also dependent entities.
- Specified by:
setExternalId
in interfaceBuildTypeIdentity
- Parameters:
cause
- configuration action caused the changenewExternalId
- new external identifier. Must be unique (case insensitively) in the scope of all build templates and build configurations (in other words, two projects with build configurations with same external id are not allowed).- Throws:
InvalidIdentifierException
- wrong identifierDuplicateExternalIdException
- a build template or a build configuration
-
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
-
unregister
public void unregister()
Description copied from interface:BuildTypeIdentityEx
Removes this object from project model. No changes on disk are performed.- Specified by:
unregister
in interfaceBuildTypeIdentityEx
- Specified by:
unregister
in interfaceBuildTypeTemplateEx
-
setExternalId
public void setExternalId(@NotNull ConfigAction configAction, @NotNull String newId, boolean sendEvents) throws InvalidIdentifierException, DuplicateExternalIdException, ObsoleteEntityException
Description copied from interface:BuildTypeIdentityEx
Same as {BuildTypeIdentity.setExternalId(ConfigAction, String)
} but provides control over events processing. If parameter sendEvents is false, then no events about changing of the external id will be sent. This mode can be useful if the events will be sent later, for instance, in case of bulk edit ids operation.- Specified by:
setExternalId
in interfaceBuildTypeIdentityEx
- Throws:
InvalidIdentifierException
DuplicateExternalIdException
ObsoleteEntityException
-
sendExtIdChangedEvents
public void sendExtIdChangedEvents(@NotNull ConfigAction cause, @NotNull String oldExternalId, @NotNull String newExternalId)
Description copied from interface:BuildTypeIdentityEx
This method can be used to send external id changed event.- Specified by:
sendExtIdChangedEvents
in interfaceBuildTypeIdentityEx
-
getParentProject
@NotNull public ProjectEx getParentProject()
Description copied from interface:BuildTypeTemplate
Returns project to which this template belongs- Specified by:
getParentProject
in interfaceBuildTypeTemplate
- Returns:
- see above
-
getParentProjectId
@NotNull public String getParentProjectId()
Description copied from interface:BuildTypeTemplate
Returns id of the project to which this template belongs- Specified by:
getParentProjectId
in interfaceBuildTypeTemplate
- Returns:
- see above
-
getProjectId
@NotNull public String getProjectId()
Description copied from interface:BuildTypeTemplate
Returns internal id of the project to which this template belongs- Specified by:
getProjectId
in interfaceBuildTypeTemplate
- Returns:
- see above
-
getChildDependencies
@NotNull public Collection<SBuildType> getChildDependencies()
Description copied from interface:Dependent
Returns all child dependencies collected down the chain. Note that returned dependencies are sorted by depth in the chain. Note that returned collection will contain accessible by current authority holder objects only.- Specified by:
getChildDependencies
in interfaceDependent
- Returns:
- see above
-
intersectsWith
public boolean intersectsWith(@NotNull Dependent dependent)
Description copied from interface:Dependent
Returns true if this object dependencies intersect (have same nodes) with specified object dependencies.- Specified by:
intersectsWith
in interfaceDependent
- Parameters:
dependent
- another object- Returns:
- see above
-
getLastConfigModificationAction
public AuditLogAction getLastConfigModificationAction()
- Specified by:
getLastConfigModificationAction
in interfaceBuildTypeTemplateEx
-
inline
@NotNull public BuildTypeTemplateEx inline()
Description copied from interface:BuildTypeTemplateEx
Creates a temporary copy of this template with all settings inherited from a project or a template inlined.- Specified by:
inline
in interfaceBuildTypeTemplateEx
-
getVcsRootInstanceEntries
@NotNull public List<VcsRootInstanceEntry> getVcsRootInstanceEntries()
- Specified by:
getVcsRootInstanceEntries
in interfaceBuildTypeTemplateEx
-
setOption
public <T> void setOption(@NotNull Option<T> option, @NotNull T value)
Description copied from interface:OptionSupport
Set option value, clears value if it is the same as default- Specified by:
setOption
in interfaceOptionSupport
- Parameters:
option
- option to set value forvalue
- option value
-
getOwnOptions
@NotNull public Collection<Option> getOwnOptions()
Description copied from interface:OptionSupport
Return options defined in this object, i.e. options for which some value has been set usingOptionSupport.setOption(Option, Object)
method.- Specified by:
getOwnOptions
in interfaceOptionSupport
- Returns:
- see above
-
getChangedOptions
@NotNull public Option[] getChangedOptions()
Description copied from interface:OptionSupport
Return options with changed values, i.e. options with non-default values- Specified by:
getChangedOptions
in interfaceOptionSupport
- Returns:
- see above
-
getOption
@NotNull public <T> T getOption(@NotNull Option<T> option)
Description copied from interface:OptionSupport
Get option value- Specified by:
getOption
in interfaceOptionSupport
- Parameters:
option
- option to retrieve value for- Returns:
- value of the option. If value wasn't set, Option:getDefaultValue is returned
-
getOptionDefaultValue
@NotNull public <T> T getOptionDefaultValue(@NotNull Option<T> option)
- Specified by:
getOptionDefaultValue
in interfaceOptionSupport
- Parameters:
option
- option whose default value to return- Returns:
- default value for specified option
-
getDependencies
@NotNull public List<Dependency> getDependencies()
Description copied from interface:DependencySettings
Get existing dependencies, empty collection when no dependencies exist- Specified by:
getDependencies
in interfaceDependencySettings
- Returns:
- see above
-
addDependency
public void addDependency(@NotNull Dependency dependOn) throws CyclicDependencyFoundException
Description copied from interface:DependencySettings
Add dependency on another build configuration- Specified by:
addDependency
in interfaceDependencySettings
- Parameters:
dependOn
- new dependency- Throws:
CyclicDependencyFoundException
- if cycle is detected
-
removeDependency
public boolean removeDependency(@NotNull Dependency dependOn)
Description copied from interface:DependencySettings
Remove dependency on another build configuration- Specified by:
removeDependency
in interfaceDependencySettings
- Parameters:
dependOn
- dependency to remove- Returns:
- true if dependency was actually removed
-
getCompatibilityMap
@NotNull public Map<SBuildAgent,CompatibilityResult> getCompatibilityMap()
Description copied from interface:CompatibleAgents
Returns compatibility map, key is an agent and value is compatibility result.- Specified by:
getCompatibilityMap
in interfaceCompatibleAgents
- Returns:
- see above
-
getCompatibleAgents
@NotNull public Collection<SBuildAgent> getCompatibleAgents()
Description copied from interface:CompatibleAgents
Returns collection of compatible agents- Specified by:
getCompatibleAgents
in interfaceCompatibleAgents
- Returns:
- see above
-
getAgentCompatibility
@NotNull public CompatibilityResult getAgentCompatibility(@NotNull AgentDescription agentDescription)
Description copied from interface:CompatibleAgents
Fetches compatibility information for given agent description- Specified by:
getAgentCompatibility
in interfaceCompatibleAgents
- Parameters:
agentDescription
- agent description- Returns:
- compatibility results.
- See Also:
CompatibilityResult
-
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
-
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
-
compareTo
public int compareTo(BuildTypeTemplate o)
- Specified by:
compareTo
in interfaceComparable<BuildTypeTemplate>
-
belongsTo
public boolean belongsTo(@NotNull SProject project)
Description copied from interface:BuildTypeIdentity
Checks whether this build type or template belongs to the specified project or one of its subprojects, transitively.- Specified by:
belongsTo
in interfaceBuildTypeIdentity
- Specified by:
belongsTo
in interfaceBuildTypeTemplate
- Parameters:
project
- the project to check this configuration to belongs to.- Returns:
- true if belongs.
-
isAccessibleFrom
public boolean isAccessibleFrom(@NotNull SProject project)
Description copied from interface:BuildTypeTemplate
Returns true if this template is accessible from specified project, i.e. it belongs to this project or to some of its parents- Specified by:
isAccessibleFrom
in interfaceBuildTypeTemplate
- Parameters:
project
- project to check- Returns:
- see above
-
isReadOnly
public boolean isReadOnly()
- Specified by:
isReadOnly
in interfaceBuildTypeSettings
- 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 interfaceBuildTypeSettings
- Specified by:
getReadOnlyReason
in interfaceSPersistentEntity
- Returns:
- reason why this entity settings are in read only state or null if they are not read only
-
getTemplateExternalId
@Nullable @Deprecated public String getTemplateExternalId()
Deprecated.- Specified by:
getTemplateExternalId
in interfaceBuildTypeSettingsEx
-
setTemplatesOrder
public void setTemplatesOrder(@NotNull List<String> templateIds)
Description copied from interface:BuildTypeSettingsEx
Imposes new order on the associated templates. Unlike#setTemplatIds
this method cannot add or remove templates.- Specified by:
setTemplatesOrder
in interfaceBuildTypeSettingsEx
- Parameters:
templateIds
- the existing template ids in the new order
-
setTemplateIds
public void setTemplateIds(@NotNull List<String> templateIds)
Description copied from interface:BuildTypeSettingsEx
Change which templates these settings are attached to. No copying of settings or cleaning of duplicates occurs in process- Specified by:
setTemplateIds
in interfaceBuildTypeSettingsEx
-
getOwnTemplateExternalIds
@NotNull public List<String> getOwnTemplateExternalIds()
- Specified by:
getOwnTemplateExternalIds
in interfaceBuildTypeOwnSettings
-
getOwnTemplateIds
@NotNull public List<String> getOwnTemplateIds()
- Specified by:
getOwnTemplateIds
in interfaceBuildTypeOwnSettings
-
getOwnOptionSupport
@NotNull public OptionSupportEx getOwnOptionSupport()
- Specified by:
getOwnOptionSupport
in interfaceBuildTypeOwnSettings
-
getOwnSerializableParameters
@NotNull public SerializableParametersCollection getOwnSerializableParameters()
- Specified by:
getOwnSerializableParameters
in interfaceBuildTypeOwnSettings
-
getOwnBuildRunners
@NotNull public List<SBuildRunnerDescriptor> getOwnBuildRunners()
- Specified by:
getOwnBuildRunners
in interfaceBuildTypeOwnSettings
-
getRunnersOrder
@Nullable public String[] getRunnersOrder()
- Specified by:
getRunnersOrder
in interfaceBuildTypeSettings
- Returns:
- runner ids in their custom order (if such order is set), null otherwise
-
getOwnBuildFeatures
@NotNull public List<SBuildFeatureDescriptor> getOwnBuildFeatures()
- Specified by:
getOwnBuildFeatures
in interfaceBuildTypeOwnSettings
-
getOwnRequirements
@NotNull public List<Requirement> getOwnRequirements()
- Specified by:
getOwnRequirements
in interfaceBuildTypeOwnSettings
-
getOwnBuildTriggers
@NotNull public List<BuildTriggerDescriptor> getOwnBuildTriggers()
- Specified by:
getOwnBuildTriggers
in interfaceBuildTypeOwnSettings
-
getOwnArtifactDependencies
@NotNull public List<SArtifactDependency> getOwnArtifactDependencies()
- Specified by:
getOwnArtifactDependencies
in interfaceBuildTypeOwnSettings
-
getOwnCleanupSupport
@NotNull public CleanupSettingsSupport getOwnCleanupSupport()
- Specified by:
getOwnCleanupSupport
in interfaceBuildTypeOwnSettings
-
getOwnParameter
@Nullable 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
-
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:
-
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
-
createConfigAction
@NotNull public ConfigAction 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 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
-
getBranchSpec
@NotNull public BranchSpec getBranchSpec(@NotNull SVcsRoot root)
Description copied from interface:BuildTypeTemplateEx
Returns branch specification for specified parent root- Specified by:
getBranchSpec
in interfaceBuildTypeTemplateEx
- Parameters:
root
- root of interest- Returns:
- see above
-
isDefaultBranchExcluded
public boolean isDefaultBranchExcluded()
Description copied from interface:BuildTypeTemplateEx
Returns true if any of VCS roots attached to configuration exclude the default branch- Specified by:
isDefaultBranchExcluded
in interfaceBuildTypeTemplateEx
- Returns:
- see above
-
isDeploymentBuildType
public boolean isDeploymentBuildType()
- Specified by:
isDeploymentBuildType
in interfaceBuildTypeTemplateEx
- Returns:
- true if build configuration inherited from this template is doing deployment
-
isCompositeBuildType
public boolean isCompositeBuildType()
- Specified by:
isCompositeBuildType
in interfaceBuildTypeSettings
- Specified by:
isCompositeBuildType
in interfaceBuildTypeTemplateEx
- Returns:
- true if build configuration inherited from this template is composite
-
isAgentLessBuildType
public boolean isAgentLessBuildType()
- Specified by:
isAgentLessBuildType
in interfaceBuildTypeSettingsEx
- Specified by:
isAgentLessBuildType
in interfaceBuildTypeTemplateEx
-
isEmptyUuid
public boolean isEmptyUuid()
- Specified by:
isEmptyUuid
in interfaceBuildTypeTemplateEx
- Returns:
- true if this template has an empty uuid in its config on disk
-
getParametersSupport
@NotNull public ContainerWithInherited<String,Parameter> getParametersSupport()
- Specified by:
getParametersSupport
in interfaceParameterSupport
-
getOptionSupport
@NotNull public ContainerWithInherited<Option<Object>,OptionValue<Object>> getOptionSupport()
- Specified by:
getOptionSupport
in interfaceBuildTypeSettingsSupport
-
getBuildFeatureSupport
@NotNull public ContainerWithDisabled<String,SBuildFeatureDescriptor> getBuildFeatureSupport()
- Specified by:
getBuildFeatureSupport
in interfaceBuildTypeSettingsSupport
-
getRequirementSupport
@NotNull public ContainerWithDisabled<String,Requirement> getRequirementSupport()
- Specified by:
getRequirementSupport
in interfaceBuildTypeSettingsSupport
-
getBuildRunnerSupport
@NotNull public ContainerWithDisabled<String,SBuildRunnerDescriptor> getBuildRunnerSupport()
- Specified by:
getBuildRunnerSupport
in interfaceBuildTypeSettingsSupport
-
getBuildTriggersSupport
@NotNull public ContainerWithDisabled<String,BuildTriggerDescriptor> getBuildTriggersSupport()
- Specified by:
getBuildTriggersSupport
in interfaceBuildTypeSettingsSupport
-
getDisabledState
@NotNull public Container<String,Boolean> getDisabledState()
- Specified by:
getDisabledState
in interfaceBuildTypeSettingsSupport
-
getRunnerConditions
@NotNull public BuildStepConditions getRunnerConditions(@NotNull SBuildRunnerDescriptor descriptor)
- Specified by:
getRunnerConditions
in interfaceBuildTypeSettings
- Returns:
- support for conditions for conditional build steps
-
-