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(long id)
          Get artifact definition of specified id
 ArtifactDefinition findArtifactDefinition(Plan plan, java.lang.String label)
          Get artifact definition associated with a plan of a given label
 java.util.List<ArtifactDefinition> findArtifactDefinitionsByPlan(Plan plan)
          Get list of artifact definitions associated with a plan
 com.google.common.collect.Multimap<Job,ArtifactDefinition> getArtifactDefinitionsByJob(Chain 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.
 java.util.Collection<ArtifactDefinitionContext> prepareDefinitionContexts(Plan plan)
          Get list of 'lightweight' artifact definitions associated with a plan
 void removeArtifactDefinition(ArtifactDefinition artifactDefinition)
          Remove artifact definition.
 void removeArtifactDefinitionsByPlan(Plan plan)
          Remove all artifact definitions associated with a plan.
 void saveArtifactDefinition(ArtifactDefinition artifactDefinition)
          Save 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
                                                   Plan 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

findArtifactDefinitionsByPlan

@NotNull
java.util.List<ArtifactDefinition> findArtifactDefinitionsByPlan(@NotNull
                                                                         Plan plan)
Get list of artifact definitions associated with a plan

Parameters:
plan - plan which associated artifact definitions should be retrieved
Returns:
list of artifact definitions

prepareDefinitionContexts

@NotNull
java.util.Collection<ArtifactDefinitionContext> prepareDefinitionContexts(@NotNull
                                                                                  Plan plan)
Get list of 'lightweight' artifact definitions associated with a plan

Parameters:
plan - plan with associated artifact definitions should be retrieved
Returns:
collection of artifact definitions (non-persistent, transmission-friendly)

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 artifact definition.

Parameters:
artifactDefinition - object to be saved/updated

saveArtifactDefinitions

void saveArtifactDefinitions(@NotNull
                             java.util.Collection<ArtifactDefinition> artifactDefinitions)
Save all artifact definitions in a collection.

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 ArtifactDefinitionBase.isSharedArtifact() returns true. If ArtifactDefinitionBase.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<Job,ArtifactDefinition> getArtifactDefinitionsByJob(@NotNull
                                                                                               Chain 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 © 2011 Atlassian. All Rights Reserved.