com.atlassian.bamboo.plan.artifact
Interface ArtifactSubscriptionManager

All Known Implementing Classes:
ArtifactSubscriptionManagerImpl

public interface ArtifactSubscriptionManager


Field Summary
static java.lang.String BAMBOO_ARTIFACTS_PATH_VARIABLE
           
 
Method Summary
 java.util.List<ArtifactSubscription> findCurrentSubscriptionsForPlan(Job producerJob)
          Get list of subscriptions existing in a chain for given artifact
 ArtifactSubscription findSubscription(long id)
          Get artifact definition of specified id
 java.util.List<ArtifactSubscription> findSubscriptionsOfPlan(Plan plan)
          Get list of artifact subscriptions associated with a plan
 java.util.List<ArtifactDefinition> findSubscriptionsPossibleForPlan(Job job)
          Get list of chain level artifacts available for specified plan
 com.google.common.collect.Multimap<ResultsSummary,ConsumedSubscription> getConsumedSubscriptions(ResultsSummary resultsSummary)
          Returns list of ConsumedSubscription ordered by order of ResultsSummary execution.
 boolean isSubscriptionsValid(Job consumer, Chain chain, java.lang.String stageName)
          Shorter for of validateSubscriptions method
 java.util.List<ArtifactSubscriptionContext> prepareSubscriptionContexts(ImmutableJob job, PlanResultKey planResultKey)
           
 void removeArtifactSubscription(ArtifactSubscription artifactSubscription)
          Remove artifact subscription.
 void removeArtifactSubscriptions(java.util.Collection<ArtifactSubscription> artifactSubscriptions)
          Remove all artifact subscriptions in the collection.
 void removeArtifactSubscriptionsOfPlan(Plan plan)
          Remove all artifact subscriptions for a plan
 void saveArtifactSubscription(ArtifactSubscription artifactSubscription)
          Save artifact subscription.
 void saveArtifactSubscriptions(java.util.Collection<ArtifactSubscription> artifactSubscriptions)
          Save all artifact definitions in a collection.
 void saveConsumedSubscription(ArtifactSubscriptionContext artifactSubscription, PlanResultKey planResultKey)
          Store consumed subscription.
 java.util.List<ArtifactSubscriptionSubstitutionAware> transformSubscriptions(java.util.List<ArtifactSubscription> subscriptions)
           
 java.util.List<ArtifactSubscription> validateSubscribersForMovedJob(Job producer, ChainStage producerStage)
          Validate all consumer artifact subscriptions to the artifacts produced by a Job against target stage
 java.util.List<ArtifactSubscription> validateSubscriptions(Job consumer, Chain chain, java.lang.String stageName)
          Validate consumer artifact subscriptions against target chain and stage
 java.util.List<ArtifactSubscription> validateSubscriptionsForMovedStage(ChainStage stage, int stageIndex)
          Validate all consumer artifact subscriptions possibly affected by moving of stage.
 

Field Detail

BAMBOO_ARTIFACTS_PATH_VARIABLE

static final java.lang.String BAMBOO_ARTIFACTS_PATH_VARIABLE
See Also:
Constant Field Values
Method Detail

findSubscription

@Nullable
ArtifactSubscription findSubscription(long id)
Get artifact definition of specified id

Parameters:
id - id of artifact subscription
Returns:
artifact definition of specified id or null if not found

findSubscriptionsOfPlan

@NotNull
java.util.List<ArtifactSubscription> findSubscriptionsOfPlan(@NotNull
                                                                     Plan plan)
Get list of artifact subscriptions associated with a plan

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

findSubscriptionsPossibleForPlan

@NotNull
java.util.List<ArtifactDefinition> findSubscriptionsPossibleForPlan(@NotNull
                                                                            Job job)
Get list of chain level artifacts available for specified plan

Parameters:
job -
Returns:
list of available artifact definitions

findCurrentSubscriptionsForPlan

@NotNull
java.util.List<ArtifactSubscription> findCurrentSubscriptionsForPlan(@NotNull
                                                                             Job producerJob)
Get list of subscriptions existing in a chain for given artifact

Parameters:
producerJob@return - list of artifact subscriptions

prepareSubscriptionContexts

@NotNull
java.util.List<ArtifactSubscriptionContext> prepareSubscriptionContexts(@NotNull
                                                                                ImmutableJob job,
                                                                                @NotNull
                                                                                PlanResultKey planResultKey)
Parameters:
job -
planResultKey -
Returns:

removeArtifactSubscription

void removeArtifactSubscription(@NotNull
                                ArtifactSubscription artifactSubscription)
Remove artifact subscription.

Parameters:
artifactSubscription - ArtifactSubscription to be removed

removeArtifactSubscriptions

void removeArtifactSubscriptions(@NotNull
                                 java.util.Collection<ArtifactSubscription> artifactSubscriptions)
Remove all artifact subscriptions in the collection.

Parameters:
artifactSubscriptions - collection of ArtifactSubscription to be removed

removeArtifactSubscriptionsOfPlan

void removeArtifactSubscriptionsOfPlan(@NotNull
                                       Plan plan)
Remove all artifact subscriptions for a plan


saveArtifactSubscription

void saveArtifactSubscription(@NotNull
                              ArtifactSubscription artifactSubscription)
Save artifact subscription.

Parameters:
artifactSubscription - object to be saved

saveArtifactSubscriptions

void saveArtifactSubscriptions(@NotNull
                               java.util.Collection<ArtifactSubscription> artifactSubscriptions)
Save all artifact definitions in a collection.

Parameters:
artifactSubscriptions - collection of objects to be saved/updated

validateSubscriptions

@NotNull
java.util.List<ArtifactSubscription> validateSubscriptions(@NotNull
                                                                   Job consumer,
                                                                   @NotNull
                                                                   Chain chain,
                                                                   @NotNull
                                                                   java.lang.String stageName)
Validate consumer artifact subscriptions against target chain and stage

Parameters:
consumer - job being consumer of artifact definitions
chain - target chain
stageName - target stage
Returns:
list of subscriptions that NOT satisfy

validateSubscribersForMovedJob

@NotNull
java.util.List<ArtifactSubscription> validateSubscribersForMovedJob(@NotNull
                                                                            Job producer,
                                                                            @NotNull
                                                                            ChainStage producerStage)
Validate all consumer artifact subscriptions to the artifacts produced by a Job against target stage

Parameters:
producer - job being producer of the artifacts
producerStage - target stage
Returns:
list of subscriptions that NOT satisfy

validateSubscriptionsForMovedStage

@NotNull
java.util.List<ArtifactSubscription> validateSubscriptionsForMovedStage(@NotNull
                                                                                ChainStage stage,
                                                                                int stageIndex)
Validate all consumer artifact subscriptions possibly affected by moving of stage.

Parameters:
stage - stage being moved
stageIndex - target stage index
Returns:
list of subscriptions that NOT satisfy

isSubscriptionsValid

boolean isSubscriptionsValid(@NotNull
                             Job consumer,
                             @NotNull
                             Chain chain,
                             @NotNull
                             java.lang.String stageName)
Shorter for of validateSubscriptions method

Parameters:
consumer - job being consumer of artifact definitions
chain - target chain
stageName - target stage
Returns:
true if all subscriptions are valid

saveConsumedSubscription

void saveConsumedSubscription(@NotNull
                              ArtifactSubscriptionContext artifactSubscription,
                              @NotNull
                              PlanResultKey planResultKey)
Store consumed subscription. Method should be called when artifacts are physically transferred to the agent

Parameters:
artifactSubscription -
planResultKey -

getConsumedSubscriptions

@NotNull
com.google.common.collect.Multimap<ResultsSummary,ConsumedSubscription> getConsumedSubscriptions(@NotNull
                                                                                                         ResultsSummary resultsSummary)
Returns list of ConsumedSubscription ordered by order of ResultsSummary execution. Artifacts whose producer does not exists are appended at the end, with null key.

Parameters:
resultsSummary - a job result
Returns:

transformSubscriptions

java.util.List<ArtifactSubscriptionSubstitutionAware> transformSubscriptions(@NotNull
                                                                             java.util.List<ArtifactSubscription> subscriptions)


Copyright © 2012 Atlassian. All Rights Reserved.