Class CopyOptions
- java.lang.Object
-
- jetbrains.buildServer.serverSide.CopyOptions
-
public class CopyOptions extends java.lang.Object
These options control how build configuration and project related data is copied.This class contains a set of behaviour options (see
CopyOptions.Option
,addOption(jetbrains.buildServer.serverSide.CopyOptions.Option)
) and identifiers mapping (seeaddProjectExternalIdMapping(java.util.Map)
.addBuildTypeAndTemplateExternalIdMapping(java.util.Map)
). The maps are used to give external identifiers to newly created entities.
-
-
Nested Class Summary
Nested Classes Modifier and Type Class Description static class
CopyOptions.Option
Different copy options that specifies the behaviour of the copy procedure.
-
Constructor Summary
Constructors Constructor Description CopyOptions()
Creates an empty set of options.CopyOptions(CopyOptions opts)
Creates a copy of given options.
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description void
addBuildTypeAndTemplateExternalIdMapping(java.util.Map<java.lang.String,java.lang.String> map)
Adds a set of mappings for external id of build configurations and templates.void
addOption(CopyOptions.Option option)
Adds a copy option.void
addProjectExternalIdMapping(java.util.Map<java.lang.String,java.lang.String> map)
Adds a set of mappings for the external id of the copying project or subprojects.void
addVcsRootExternalIdMapping(java.util.Map<java.lang.String,java.lang.String> map)
Adds a set of mappings for external id of VCS roots.java.util.Map<java.lang.String,java.lang.String>
getBuildTypeAndTemplateExternalIdentifiersMap()
Returns the build configurations and templates external ids mapping.java.lang.String
getNewProjectName()
Returns the new project name.java.util.Map<java.lang.String,java.lang.String>
getProjectExternalIdentifiersMap()
Returns the project external ids mapping.java.util.Map<java.lang.String,java.lang.String>
getVcsRootExternalIdentifiersMap()
Returns the build configurations and templates external ids mapping.boolean
isGenerateExternalIdsBasedOnOriginalExternalIds()
Determines how external ids for new entities will be generated if there are no related pairs in the external ids maps.boolean
isOptionSet(CopyOptions.Option option)
Determines whether the specified options is added.void
removeOption(CopyOptions.Option option)
Removes a copy option.void
setGenerateExternalIdsBasedOnOriginalExternalIds(boolean generateExternalIdsBasedOnOriginalExternalIds)
Specify how external ids for new entities will be generated if there are no related pairs in the external ids maps.void
setNewProjectName(java.lang.String newProjectName)
Sets the new project name.
-
-
-
Constructor Detail
-
CopyOptions
public CopyOptions()
Creates an empty set of options.
-
CopyOptions
public CopyOptions(@NotNull CopyOptions opts)
Creates a copy of given options.- Parameters:
opts
- options to copy.
-
-
Method Detail
-
getNewProjectName
@Nullable public java.lang.String getNewProjectName()
Returns the new project name.- Returns:
- see above.
- See Also:
setNewProjectName(java.lang.String)
-
setNewProjectName
public void setNewProjectName(@Nullable java.lang.String newProjectName)
Sets the new project name. This name is applicable to the new project only (without subprojects).- Parameters:
newProjectName
- new project name. If null, the current name will be used (it can be a bit modified to ensure uniqueness).- See Also:
getNewProjectName()
-
addOption
public void addOption(@NotNull CopyOptions.Option option)
Adds a copy option. See possible options here:CopyOptions.Option
.- Parameters:
option
- see above.- See Also:
removeOption(jetbrains.buildServer.serverSide.CopyOptions.Option)
,isOptionSet(jetbrains.buildServer.serverSide.CopyOptions.Option)
-
removeOption
public void removeOption(@NotNull CopyOptions.Option option)
Removes a copy option.- Parameters:
option
- see above.- See Also:
addOption(jetbrains.buildServer.serverSide.CopyOptions.Option)
,isOptionSet(jetbrains.buildServer.serverSide.CopyOptions.Option)
-
isOptionSet
public boolean isOptionSet(@NotNull CopyOptions.Option option)
Determines whether the specified options is added.- Parameters:
option
- the option to check.- Returns:
- see above.
- See Also:
addOption(jetbrains.buildServer.serverSide.CopyOptions.Option)
-
addProjectExternalIdMapping
public void addProjectExternalIdMapping(@NotNull java.util.Map<java.lang.String,java.lang.String> map)
Adds a set of mappings for the external id of the copying project or subprojects.This mapping is optional. When some projects have no associated mappings, new external ids will be generated based on their names and parent projects external ids.
The copying project's external identifier is also applicable to this map.
The specified mapping will be added to the previous added mapping.
- Parameters:
map
- identifiers map- Since:
- 8.0
- See Also:
getProjectExternalIdentifiersMap()
-
addVcsRootExternalIdMapping
public void addVcsRootExternalIdMapping(@NotNull java.util.Map<java.lang.String,java.lang.String> map)
Adds a set of mappings for external id of VCS roots.This mapping is optional. When some VCS roots have no associated mappings, new external ids will be generated based on their names and projects external ids.
The specified mapping will be added to the previous added mapping.
- Parameters:
map
- map of the existent VCS root id to the VCS root id for the copy.- Since:
- 8.0
- See Also:
addProjectExternalIdMapping(java.util.Map)
,getBuildTypeAndTemplateExternalIdentifiersMap()
-
addBuildTypeAndTemplateExternalIdMapping
public void addBuildTypeAndTemplateExternalIdMapping(@NotNull java.util.Map<java.lang.String,java.lang.String> map)
Adds a set of mappings for external id of build configurations and templates.This mapping is optional. When some build configurations ore templates have no associated mappings, new external ids will be generated based on their names and projects external ids.
The specified mapping will be added to the previous added mapping.
- Parameters:
map
- map of the existent entity id to the entity id for the copy.- Since:
- 8.0
- See Also:
addProjectExternalIdMapping(java.util.Map)
,getBuildTypeAndTemplateExternalIdentifiersMap()
-
getProjectExternalIdentifiersMap
@NotNull public java.util.Map<java.lang.String,java.lang.String> getProjectExternalIdentifiersMap()
Returns the project external ids mapping.- Returns:
- project external ids mapping (as a map of existent project external id to the external id for the related project copy).
- Since:
- 8.0
- See Also:
addProjectExternalIdMapping(java.util.Map)
-
getVcsRootExternalIdentifiersMap
@NotNull public java.util.Map<java.lang.String,java.lang.String> getVcsRootExternalIdentifiersMap()
Returns the build configurations and templates external ids mapping.- Returns:
- build configurations and templates external ids mapping (as a map of existent build configuration or template external id to the external id for the related copy).
- Since:
- 8.0
- See Also:
addBuildTypeAndTemplateExternalIdMapping(java.util.Map)
-
getBuildTypeAndTemplateExternalIdentifiersMap
@NotNull public java.util.Map<java.lang.String,java.lang.String> getBuildTypeAndTemplateExternalIdentifiersMap()
Returns the build configurations and templates external ids mapping.- Returns:
- build configurations and templates external ids mapping (as a map of existent build configuration or template external id to the external id for the related copy).
- Since:
- 8.0
- See Also:
addBuildTypeAndTemplateExternalIdMapping(java.util.Map)
-
isGenerateExternalIdsBasedOnOriginalExternalIds
public boolean isGenerateExternalIdsBasedOnOriginalExternalIds()
Determines how external ids for new entities will be generated if there are no related pairs in the external ids maps.- Returns:
- false means use entity name for generating new external id, true means try to use ids similar external ids of original entities.
- Since:
- 8.0
- See Also:
setGenerateExternalIdsBasedOnOriginalExternalIds(boolean)
-
setGenerateExternalIdsBasedOnOriginalExternalIds
public void setGenerateExternalIdsBasedOnOriginalExternalIds(boolean generateExternalIdsBasedOnOriginalExternalIds)
Specify how external ids for new entities will be generated if there are no related pairs in the external ids maps.- Parameters:
generateExternalIdsBasedOnOriginalExternalIds
- false means use entity name for generating new external id, true means try to use ids similar external ids of original entities.- Since:
- 8.0
- See Also:
isGenerateExternalIdsBasedOnOriginalExternalIds()
-
-