Interface ArtifactDefinitionManager
- All Known Implementing Classes:
ArtifactDefinitionManagerImpl
@PublicApi
public interface ArtifactDefinitionManager
-
Method Summary
Modifier and TypeMethodDescription@NotNull Map<ArtifactDefinition,
ArtifactDefinition> cloneArtifactDefinitions
(@NotNull Job sourcePlan, @NotNull Job targetPlan) @NotNull Map<ArtifactDefinition,
ArtifactDefinition> cloneArtifactDefinitions
(@NotNull Job sourcePlan, @NotNull Job targetPlan, boolean preserveSharedFlag) @Nullable ArtifactDefinition
findArtifactDefinition
(long id) Get artifact definition of specified id@Nullable ArtifactDefinition
findArtifactDefinition
(@NotNull ImmutablePlan plan, @NotNull String label) Get artifact definition associated with a plan of a given label@Nullable ArtifactDefinition
findArtifactDefinitionByChain
(@NotNull ImmutablePlan plan, @NotNull String label) @NotNull List<ArtifactDefinition>
findArtifactDefinitionsByPlan
(@NotNull ImmutablePlan plan) Get list of artifact definitions associated with a specific plan.@NotNull List<ArtifactDefinition>
findSharedArtifactsByChain
(@NotNull ImmutableChain chain) Find all shared artifacts that exist for a particular chain (looks through all jobs).@NotNull Multimap<? extends ImmutableJob,
ArtifactDefinition> getArtifactDefinitionsByJob
(@NotNull ImmutableChain chain, Predicate<ArtifactDefinitionBase> predicate) ReturnsArtifactDefinition
grouped byJob
where definitions are definedboolean
isArtifactDefinitionNameUniqueInChain
(@NotNull ArtifactDefinition artifactDefinition) Test if artifact definition's name is unique within a chain that producer plan belongs to.boolean
isArtifactDefinitionNameUniqueInJob
(@NotNull ArtifactDefinition artifactDefinition) Test if artifact definition's name is unique within a producer job.void
removeArtifactDefinition
(@NotNull ArtifactDefinition artifactDefinition) Remove artifact definition.void
removeArtifactDefinitionsByPlan
(@NotNull ImmutablePlan plan) Remove all artifact definitions associated with a plan.void
removeArtifactDefinitionsByPlan
(@NotNull Plan plan) Deprecated.void
saveArtifactDefinition
(@NotNull ArtifactDefinition artifactDefinition) Save/update artifact definition.void
saveArtifactDefinitions
(@NotNull Collection<ArtifactDefinition> artifactDefinitions) Save all artifact definitions in a collection.
-
Method Details
-
findArtifactDefinition
Get artifact definition of specified id- Parameters:
id
- id of artifact definition- Returns:
- artifact definition of specified id or null if not found
-
findArtifactDefinition
@Nullable @Nullable ArtifactDefinition findArtifactDefinition(@NotNull @NotNull ImmutablePlan plan, @NotNull @NotNull String label) Get artifact definition associated with a plan of a given label- Parameters:
plan
- plan which associated artifact definition should be retrievedlabel
- label to search among plan's artifact definitions- Returns:
- artifact definition matching plan and label or null if not found
-
findArtifactDefinitionByChain
@Nullable @Nullable ArtifactDefinition findArtifactDefinitionByChain(@NotNull @NotNull ImmutablePlan plan, @NotNull @NotNull String label) -
findArtifactDefinitionsByPlan
@NotNull @NotNull List<ArtifactDefinition> findArtifactDefinitionsByPlan(@NotNull @NotNull ImmutablePlan plan) Get list of artifact definitions associated with a specific plan. (Does not recurse into children. i.e. if passed a chain, wont look at jobs)- Parameters:
plan
- plan which associated artifact definitions should be retrieved- Returns:
- list of artifact definitions
-
removeArtifactDefinition
Remove artifact definition.- Parameters:
artifactDefinition
-ArtifactDefinition
to be removed
-
removeArtifactDefinitionsByPlan
Deprecated.since 6.2 useremoveArtifactDefinitionsByPlan(ImmutablePlan)
insteadRemove all artifact definitions associated with a plan.- Parameters:
plan
- plan which associated artifact definitions should be removed
-
removeArtifactDefinitionsByPlan
Remove all artifact definitions associated with a plan.- Parameters:
plan
- plan which associated artifact definitions should be removed
-
saveArtifactDefinition
Save/update artifact definition. This method will generate appropriate event for saved/updated artifactDefinition.- Parameters:
artifactDefinition
- object to be saved/updated
-
saveArtifactDefinitions
Save all artifact definitions in a collection. This method will generate event for each newly created artifact in the list.- Parameters:
artifactDefinitions
- collection of objects to be saved/updated
-
cloneArtifactDefinitions
@NotNull @NotNull Map<ArtifactDefinition,ArtifactDefinition> cloneArtifactDefinitions(@NotNull @NotNull Job sourcePlan, @NotNull @NotNull Job targetPlan, boolean preserveSharedFlag) Creates artifact definitions objects for aBuildable
plan based according to definitions associated with inputBuildable
plan. This method does not persist the objects.- Parameters:
sourcePlan
- plan which associated artifact definitions should be clonedtargetPlan
- plan for which artifacts should be createdpreserveSharedFlag
- false will degrade all the artifacts to job level artifacts- Returns:
- map of original and cloned artifact definitions
-
cloneArtifactDefinitions
@NotNull @NotNull Map<ArtifactDefinition,ArtifactDefinition> cloneArtifactDefinitions(@NotNull @NotNull Job sourcePlan, @NotNull @NotNull Job targetPlan) Creates artifact definitions objects for aBuildable
plan based according to definitions associated with inputBuildable
plan. This method does not persist the objects. SharedArtifact flags are copied.- Parameters:
sourcePlan
- plan which associated artifact definitions should be clonedtargetPlan
- plan for which artifacts should be created- Returns:
- map of original and cloned artifact definitions
-
isArtifactDefinitionNameUniqueInJob
boolean isArtifactDefinitionNameUniqueInJob(@NotNull @NotNull ArtifactDefinition artifactDefinition) Test if artifact definition's name is unique within a producer job.- Parameters:
artifactDefinition
- artifact definition to be validated- Returns:
- true if name is unique
-
isArtifactDefinitionNameUniqueInChain
boolean isArtifactDefinitionNameUniqueInChain(@NotNull @NotNull ArtifactDefinition artifactDefinition) Test if artifact definition's name is unique within a chain that producer plan belongs to. That check is performed only ifImmutableArtifactDefinitionBase.isSharedArtifact()
returns true. IfImmutableArtifactDefinitionBase.isSharedArtifact()
returns false this method will always return true.- Parameters:
artifactDefinition
- artifact definition to be validated- Returns:
- true if name is unique or sharedArtifact flag is set to false
-
getArtifactDefinitionsByJob
@NotNull @NotNull Multimap<? extends ImmutableJob,ArtifactDefinition> getArtifactDefinitionsByJob(@NotNull @NotNull ImmutableChain chain, Predicate<ArtifactDefinitionBase> predicate) ReturnsArtifactDefinition
grouped byJob
where definitions are defined- Parameters:
chain
-predicate
- for filtering definition types- Returns:
-
removeArtifactDefinitionsByPlan(ImmutablePlan)
instead