com.atlassian.bamboo.plan.artifact
Interface ArtifactDefinitionManager

All Known Implementing Classes:
ArtifactDefinitionManagerImpl

public interface ArtifactDefinitionManager


Method Summary
 java.util.Map<ArtifactDefinition,ArtifactDefinition> cloneArtifactDefinitions(Job sourcePlan, Job targetPlan)
          Creates artifact definitions objects for a Buildable plan based according to definitions associated with input Buildable plan.
 java.util.Map<ArtifactDefinition,ArtifactDefinition> cloneArtifactDefinitions(Job sourcePlan, Job targetPlan, boolean preserveSharedFlag)
          Creates artifact definitions objects for a Buildable plan based according to definitions associated with input Buildable plan.
 ArtifactDefinition findArtifactDefinition(ImmutablePlan plan, java.lang.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, java.lang.String label)
           
 java.util.List<ArtifactDefinition> findArtifactDefinitionsByPlan(ImmutablePlan plan)
          Get list of artifact definitions associated with a specific plan.
 java.util.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)
          Returns ArtifactDefinition grouped by Job where definitions are defined
 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(Plan plan)
          Remove all artifact definitions associated with a plan.
 void saveArtifactDefinition(ArtifactDefinition artifactDefinition)
          Save/update artifact definition.
 void saveArtifactDefinitions(java.util.Collection<ArtifactDefinition> artifactDefinitions)
          Save all artifact definitions in a collection.
 

Method Detail

findArtifactDefinition

@Nullable
ArtifactDefinition findArtifactDefinition(long id)
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
ArtifactDefinition findArtifactDefinition(@NotNull
                                                   ImmutablePlan plan,
                                                   @NotNull
                                                   java.lang.String label)
Get artifact definition associated with a plan of a given label

Parameters:
plan - plan which associated artifact definition should be retrieved
label - label to search among plan's artifact definitions
Returns:
artifact definition matching plan and label or null if not found

findArtifactDefinitionByChain

@Nullable
ArtifactDefinition findArtifactDefinitionByChain(@NotNull
                                                          ImmutablePlan plan,
                                                          @NotNull
                                                          java.lang.String label)

findArtifactDefinitionsByPlan

@NotNull
java.util.List<ArtifactDefinition> findArtifactDefinitionsByPlan(@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

findSharedArtifactsByChain

@NotNull
java.util.List<ArtifactDefinition> findSharedArtifactsByChain(@NotNull
                                                                      ImmutableChain chain)
Find all shared artifacts that exist for a particular chain (Looks through all jobs)

Parameters:
chain - chain which associated artifact definitions should be retrieved
Returns:
shared artifacts that exist for the specified particular chain

removeArtifactDefinition

void removeArtifactDefinition(@NotNull
                              ArtifactDefinition artifactDefinition)
Remove artifact definition.

Parameters:
artifactDefinition - ArtifactDefinition to be removed

removeArtifactDefinitionsByPlan

void removeArtifactDefinitionsByPlan(@NotNull
                                     Plan plan)
Remove all artifact definitions associated with a plan.

Parameters:
plan - plan which associated artifact definitions should be removed

saveArtifactDefinition

void saveArtifactDefinition(@NotNull
                            ArtifactDefinition artifactDefinition)
Save/update artifact definition. This method will generate appropriate event for saved/updated artifactDefinition.

Parameters:
artifactDefinition - object to be saved/updated

saveArtifactDefinitions

void saveArtifactDefinitions(@NotNull
                             java.util.Collection<ArtifactDefinition> artifactDefinitions)
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
java.util.Map<ArtifactDefinition,ArtifactDefinition> cloneArtifactDefinitions(@NotNull
                                                                                      Job sourcePlan,
                                                                                      @NotNull
                                                                                      Job targetPlan,
                                                                                      boolean preserveSharedFlag)
Creates artifact definitions objects for a Buildable plan based according to definitions associated with input Buildable plan. This method does not persist the objects.

Parameters:
sourcePlan - plan which associated artifact definitions should be cloned
targetPlan - plan for which artifacts should be created
preserveSharedFlag - false will degrade all the artifacts to job level artifacts
Returns:
map of original and cloned artifact definitions

cloneArtifactDefinitions

@NotNull
java.util.Map<ArtifactDefinition,ArtifactDefinition> cloneArtifactDefinitions(@NotNull
                                                                                      Job sourcePlan,
                                                                                      @NotNull
                                                                                      Job targetPlan)
Creates artifact definitions objects for a Buildable plan based according to definitions associated with input Buildable plan. This method does not persist the objects. SharedArtifact flags are copied.

Parameters:
sourcePlan - plan which associated artifact definitions should be cloned
targetPlan - plan for which artifacts should be created
Returns:
map of original and cloned artifact definitions

isArtifactDefinitionNameUniqueInJob

boolean isArtifactDefinitionNameUniqueInJob(@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
                                              ArtifactDefinition artifactDefinition)
Test if artifact definition's name is unique within a chain that producer plan belongs to. That check is performed only if ImmutableArtifactDefinitionBase.isSharedArtifact() returns true. If ImmutableArtifactDefinitionBase.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
com.google.common.collect.Multimap<? extends ImmutableJob,ArtifactDefinition> getArtifactDefinitionsByJob(@NotNull
                                                                                                                  ImmutableChain chain,
                                                                                                                  com.google.common.base.Predicate<ArtifactDefinitionBase> predicate)
Returns ArtifactDefinition grouped by Job where definitions are defined

Parameters:
chain -
predicate - for filtering definition types
Returns:


Copyright © 2013 Atlassian Software Systems Pty Ltd. All Rights Reserved.