public class ArtifactDefinitionManagerImpl extends Object implements ArtifactDefinitionManager
Constructor and Description |
---|
ArtifactDefinitionManagerImpl(ArtifactDefinitionDao artifactDefinitionDao,
com.atlassian.event.api.EventPublisher eventPublisher) |
Modifier and Type | Method and Description |
---|---|
Map<ArtifactDefinition,ArtifactDefinition> |
cloneArtifactDefinitions(Job sourcePlan,
Job targetPlan)
|
Map<ArtifactDefinition,ArtifactDefinition> |
cloneArtifactDefinitions(Job sourcePlan,
Job targetPlan,
boolean preserveSharedFlag)
|
ArtifactDefinition |
findArtifactDefinition(ImmutablePlan plan,
String label)
Get artifact definition associated with a plan of a given label
|
ArtifactDefinition |
findArtifactDefinition(long id)
Get artifact definition of specified id
|
ArtifactDefinition |
findArtifactDefinitionByChain(ImmutablePlan plan,
String label) |
List<ArtifactDefinition> |
findArtifactDefinitionsByPlan(ImmutablePlan plan)
Get list of artifact definitions associated with a specific plan.
|
List<ArtifactDefinition> |
findSharedArtifactsByChain(ImmutableChain chain)
Find all shared artifacts that exist for a particular chain (looks through all jobs).
|
com.google.common.collect.Multimap<? extends ImmutableJob,ArtifactDefinition> |
getArtifactDefinitionsByJob(ImmutableChain chain,
com.google.common.base.Predicate<ArtifactDefinitionBase> predicate)
Get
ArtifactDefinition grouped by Job |
boolean |
isArtifactDefinitionNameUniqueInChain(ArtifactDefinition artifactDefinition)
Test if artifact definition's name is unique within a chain that producer plan belongs to.
|
boolean |
isArtifactDefinitionNameUniqueInJob(ArtifactDefinition artifactDefinition)
Test if artifact definition's name is unique within a producer job.
|
void |
removeArtifactDefinition(ArtifactDefinition artifactDefinition)
Remove artifact definition.
|
void |
removeArtifactDefinitionsByPlan(ImmutablePlan plan)
Remove all artifact definitions associated with a plan.
|
void |
removeArtifactDefinitionsByPlan(Plan plan)
Remove all artifact definitions associated with a plan.
|
void |
saveArtifactDefinition(ArtifactDefinition artifactDefinition)
Save/update artifact definition.
|
void |
saveArtifactDefinitions(Collection<ArtifactDefinition> artifactDefinitions)
Save all artifact definitions in a collection.
|
public ArtifactDefinitionManagerImpl(ArtifactDefinitionDao artifactDefinitionDao, com.atlassian.event.api.EventPublisher eventPublisher)
@Nullable public ArtifactDefinition findArtifactDefinition(long id)
ArtifactDefinitionManager
findArtifactDefinition
in interface ArtifactDefinitionManager
id
- id of artifact definition@Nullable public ArtifactDefinition findArtifactDefinition(@NotNull ImmutablePlan plan, @NotNull String label)
ArtifactDefinitionManager
findArtifactDefinition
in interface ArtifactDefinitionManager
plan
- plan which associated artifact definition should be retrievedlabel
- label to search among plan's artifact definitions@Nullable public ArtifactDefinition findArtifactDefinitionByChain(@NotNull ImmutablePlan plan, @NotNull String label)
findArtifactDefinitionByChain
in interface ArtifactDefinitionManager
@NotNull public List<ArtifactDefinition> findArtifactDefinitionsByPlan(@NotNull ImmutablePlan plan)
ArtifactDefinitionManager
findArtifactDefinitionsByPlan
in interface ArtifactDefinitionManager
plan
- plan which associated artifact definitions should be retrieved@NotNull public List<ArtifactDefinition> findSharedArtifactsByChain(@NotNull ImmutableChain chain)
ArtifactDefinitionManager
findSharedArtifactsByChain
in interface ArtifactDefinitionManager
chain
- chain which associated artifact definitions should be retrievedpublic void removeArtifactDefinition(@NotNull ArtifactDefinition artifactDefinition)
ArtifactDefinitionManager
removeArtifactDefinition
in interface ArtifactDefinitionManager
artifactDefinition
- ArtifactDefinition
to be removedpublic void removeArtifactDefinitionsByPlan(@NotNull Plan plan)
ArtifactDefinitionManager
removeArtifactDefinitionsByPlan
in interface ArtifactDefinitionManager
plan
- plan which associated artifact definitions should be removedpublic void removeArtifactDefinitionsByPlan(@NotNull ImmutablePlan plan)
ArtifactDefinitionManager
removeArtifactDefinitionsByPlan
in interface ArtifactDefinitionManager
plan
- plan which associated artifact definitions should be removedpublic void saveArtifactDefinition(@NotNull ArtifactDefinition artifactDefinition)
ArtifactDefinitionManager
saveArtifactDefinition
in interface ArtifactDefinitionManager
artifactDefinition
- object to be saved/updatedpublic void saveArtifactDefinitions(@NotNull Collection<ArtifactDefinition> artifactDefinitions)
ArtifactDefinitionManager
saveArtifactDefinitions
in interface ArtifactDefinitionManager
artifactDefinitions
- collection of objects to be saved/updated@NotNull public Map<ArtifactDefinition,ArtifactDefinition> cloneArtifactDefinitions(@NotNull Job sourcePlan, @NotNull Job targetPlan)
ArtifactDefinitionManager
Buildable
plan based according to definitions associated with input Buildable
plan.
This method does not persist the objects. SharedArtifact flags are copied.cloneArtifactDefinitions
in interface ArtifactDefinitionManager
sourcePlan
- plan which associated artifact definitions should be clonedtargetPlan
- plan for which artifacts should be created@NotNull public Map<ArtifactDefinition,ArtifactDefinition> cloneArtifactDefinitions(@NotNull Job sourcePlan, @NotNull Job targetPlan, boolean preserveSharedFlag)
ArtifactDefinitionManager
Buildable
plan based according to definitions associated with
input Buildable
plan. This method does not persist the objects.cloneArtifactDefinitions
in interface ArtifactDefinitionManager
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 artifactspublic boolean isArtifactDefinitionNameUniqueInChain(@NotNull ArtifactDefinition artifactDefinition)
ArtifactDefinitionManager
ImmutableArtifactDefinitionBase.isSharedArtifact()
returns true.
If ImmutableArtifactDefinitionBase.isSharedArtifact()
returns false this method will always return true.isArtifactDefinitionNameUniqueInChain
in interface ArtifactDefinitionManager
artifactDefinition
- artifact definition to be validatedpublic boolean isArtifactDefinitionNameUniqueInJob(@NotNull ArtifactDefinition artifactDefinition)
ArtifactDefinitionManager
isArtifactDefinitionNameUniqueInJob
in interface ArtifactDefinitionManager
artifactDefinition
- artifact definition to be validated@NotNull public com.google.common.collect.Multimap<? extends ImmutableJob,ArtifactDefinition> getArtifactDefinitionsByJob(@NotNull ImmutableChain chain, com.google.common.base.Predicate<ArtifactDefinitionBase> predicate)
ArtifactDefinition
grouped by Job
getArtifactDefinitionsByJob
in interface ArtifactDefinitionManager
chain
- predicate
- for filtering definition typesCopyright © 2020 Atlassian Software Systems Pty Ltd. All rights reserved.