public class ArtifactSubscriptionManagerImpl extends Object implements ArtifactSubscriptionManager
BAMBOO_ARTIFACTS_PATH_VARIABLE
Constructor and Description |
---|
ArtifactSubscriptionManagerImpl(ArtifactDefinitionManager artifactDefinitionManager,
ArtifactSubscriptionDao artifactSubscriptionDao,
ConsumedSubscriptionDao consumedSubscriptionDao,
ArtifactLinkDao artifactLinkDao,
ResultsSummaryManager resultsSummaryManager) |
Modifier and Type | Method and Description |
---|---|
long |
countSubscriptionsOfArtifact(long artifactDefinitionId) |
@NotNull List<ArtifactSubscription> |
findCurrentSubscriptionsForPlan(@NotNull ImmutableJob producerJob)
Get list of subscriptions existing in a chain for given artifact
|
ArtifactSubscription |
findSubscription(long id)
Get artifact definition of specified id
|
@NotNull List<ArtifactSubscription> |
findSubscriptionsOfPlan(@NotNull PlanIdentifier plan)
Get list of artifact subscriptions associated with a plan
|
@NotNull List<ArtifactDefinition> |
findSubscriptionsPossibleForPlan(@NotNull ImmutableJob job)
Get list of chain level artifacts available for specified plan
|
@NotNull com.google.common.collect.Multimap<ResultsSummary,ConsumedSubscription> |
getConsumedSubscriptions(@NotNull ResultsSummary resultsSummary)
Returns list of
ConsumedSubscription ordered by order of ResultsSummary execution. |
boolean |
isSubscriptionsValid(@NotNull Job consumer,
@NotNull Chain chain,
@NotNull String stageName)
Shorter for of validateSubscriptions method
|
@NotNull List<ArtifactDefinitionContext> |
prepareArtifactDefinitionContexts(@NotNull ImmutableJob job,
@NotNull BuildContext buildContext,
SecureToken secureToken)
Helps prepare the artifact definitions
|
@NotNull List<ArtifactSubscriptionContext> |
prepareSubscriptionContexts(@NotNull ImmutableJob job,
@NotNull BuildContext parentBuildContext,
SecureToken secureToken) |
void |
removeArtifactSubscription(@NotNull ArtifactSubscription artifactSubscription)
Remove artifact subscription.
|
void |
removeArtifactSubscriptions(@NotNull Collection<ArtifactSubscription> artifactSubscriptions)
Remove all artifact subscriptions in the collection.
|
void |
removeArtifactSubscriptionsOfPlan(@NotNull ImmutablePlan plan)
Remove all artifact subscriptions for a plan
|
void |
removeArtifactSubscriptionsOfPlan(@NotNull Plan plan)
Remove all artifact subscriptions for a plan
|
void |
saveArtifactSubscription(@NotNull ArtifactSubscription artifactSubscription)
Save artifact subscription.
|
void |
saveArtifactSubscriptions(@NotNull Collection<ArtifactSubscription> artifactSubscriptions)
Save all artifact definitions in a collection.
|
void |
saveConsumedSubscription(@NotNull ArtifactSubscriptionContext artifactSubscription,
@NotNull PlanResultKey planResultKey,
@NotNull String artifactLinkType)
Store consumed subscription.
|
List<ArtifactSubscriptionSubstitutionAware> |
transformSubscriptions(@NotNull List<ArtifactSubscription> subscriptions) |
@NotNull List<ArtifactSubscription> |
validateSubscribersForMovedJob(@NotNull ImmutableJob producer,
@NotNull ImmutableChainStage destinationStage)
Validate all consumer artifact subscriptions to the artifacts produced by a Job against target stage
|
@NotNull List<ArtifactSubscription> |
validateSubscriptions(@NotNull ImmutableJob consumer,
@NotNull ImmutableChain chain,
@NotNull String stageName)
Validate consumer artifact subscriptions against target chain and stage
|
@NotNull List<ArtifactSubscription> |
validateSubscriptionsForMovedJob(@NotNull ImmutableJob job,
@NotNull ImmutableChainStage targetStage)
Validate all artifact subscriptions possibly affected by moving a job.
|
@NotNull List<ArtifactSubscription> |
validateSubscriptionsForMovedStage(@NotNull ImmutableChainStage stageToMove,
int newIndex)
Validates all artifact subscriptions possibly affected by moving a stage.
|
public ArtifactSubscriptionManagerImpl(ArtifactDefinitionManager artifactDefinitionManager, ArtifactSubscriptionDao artifactSubscriptionDao, ConsumedSubscriptionDao consumedSubscriptionDao, ArtifactLinkDao artifactLinkDao, ResultsSummaryManager resultsSummaryManager)
public ArtifactSubscription findSubscription(long id)
ArtifactSubscriptionManager
findSubscription
in interface ArtifactSubscriptionManager
id
- id of artifact subscription@NotNull public @NotNull List<ArtifactSubscription> findSubscriptionsOfPlan(@NotNull @NotNull PlanIdentifier plan)
ArtifactSubscriptionManager
findSubscriptionsOfPlan
in interface ArtifactSubscriptionManager
plan
- plan which associated artifact subscriptions should be retrievedpublic List<ArtifactSubscriptionSubstitutionAware> transformSubscriptions(@NotNull @NotNull List<ArtifactSubscription> subscriptions)
transformSubscriptions
in interface ArtifactSubscriptionManager
@NotNull public @NotNull List<ArtifactDefinition> findSubscriptionsPossibleForPlan(@NotNull @NotNull ImmutableJob job)
ArtifactSubscriptionManager
findSubscriptionsPossibleForPlan
in interface ArtifactSubscriptionManager
@NotNull public @NotNull List<ArtifactSubscription> findCurrentSubscriptionsForPlan(@NotNull @NotNull ImmutableJob producerJob)
ArtifactSubscriptionManager
findCurrentSubscriptionsForPlan
in interface ArtifactSubscriptionManager
@NotNull public @NotNull List<ArtifactSubscription> validateSubscribersForMovedJob(@NotNull @NotNull ImmutableJob producer, @NotNull @NotNull ImmutableChainStage destinationStage)
ArtifactSubscriptionManager
validateSubscribersForMovedJob
in interface ArtifactSubscriptionManager
producer
- job being producer of the artifactsdestinationStage
- target stage@NotNull public @NotNull List<ArtifactSubscription> validateSubscriptions(@NotNull @NotNull ImmutableJob consumer, @NotNull @NotNull ImmutableChain chain, @NotNull @NotNull String stageName)
ArtifactSubscriptionManager
validateSubscriptions
in interface ArtifactSubscriptionManager
consumer
- job being consumer of artifact definitionschain
- target chainstageName
- target stage@NotNull public @NotNull List<ArtifactSubscription> validateSubscriptionsForMovedJob(@NotNull @NotNull ImmutableJob job, @NotNull @NotNull ImmutableChainStage targetStage)
ArtifactSubscriptionManager
validateSubscriptionsForMovedJob
in interface ArtifactSubscriptionManager
job
- job being movedtargetStage
- target stageArtifactSubscription
that won't qualify after the move@NotNull public @NotNull List<ArtifactSubscription> validateSubscriptionsForMovedStage(@NotNull @NotNull ImmutableChainStage stageToMove, int newIndex)
ArtifactSubscriptionManager
validateSubscriptionsForMovedStage
in interface ArtifactSubscriptionManager
stageToMove
- stage being movednewIndex
- target stage indexArtifactSubscription
that won't qualify after the movepublic boolean isSubscriptionsValid(@NotNull @NotNull Job consumer, @NotNull @NotNull Chain chain, @NotNull @NotNull String stageName)
ArtifactSubscriptionManager
isSubscriptionsValid
in interface ArtifactSubscriptionManager
consumer
- job being consumer of artifact definitionschain
- target chainstageName
- target stage@NotNull public @NotNull List<ArtifactSubscriptionContext> prepareSubscriptionContexts(@NotNull @NotNull ImmutableJob job, @NotNull @NotNull BuildContext parentBuildContext, SecureToken secureToken)
prepareSubscriptionContexts
in interface ArtifactSubscriptionManager
@NotNull public @NotNull List<ArtifactDefinitionContext> prepareArtifactDefinitionContexts(@NotNull @NotNull ImmutableJob job, @NotNull @NotNull BuildContext buildContext, SecureToken secureToken)
ArtifactSubscriptionManager
prepareArtifactDefinitionContexts
in interface ArtifactSubscriptionManager
public void removeArtifactSubscription(@NotNull @NotNull ArtifactSubscription artifactSubscription)
ArtifactSubscriptionManager
removeArtifactSubscription
in interface ArtifactSubscriptionManager
artifactSubscription
- ArtifactSubscription
to be removedpublic void removeArtifactSubscriptions(@NotNull @NotNull Collection<ArtifactSubscription> artifactSubscriptions)
ArtifactSubscriptionManager
removeArtifactSubscriptions
in interface ArtifactSubscriptionManager
artifactSubscriptions
- collection of ArtifactSubscription
to be removedpublic void removeArtifactSubscriptionsOfPlan(@NotNull @NotNull Plan plan)
ArtifactSubscriptionManager
removeArtifactSubscriptionsOfPlan
in interface ArtifactSubscriptionManager
public void removeArtifactSubscriptionsOfPlan(@NotNull @NotNull ImmutablePlan plan)
ArtifactSubscriptionManager
removeArtifactSubscriptionsOfPlan
in interface ArtifactSubscriptionManager
public void saveArtifactSubscription(@NotNull @NotNull ArtifactSubscription artifactSubscription)
ArtifactSubscriptionManager
saveArtifactSubscription
in interface ArtifactSubscriptionManager
artifactSubscription
- object to be savedpublic void saveArtifactSubscriptions(@NotNull @NotNull Collection<ArtifactSubscription> artifactSubscriptions)
ArtifactSubscriptionManager
saveArtifactSubscriptions
in interface ArtifactSubscriptionManager
artifactSubscriptions
- collection of objects to be saved/updatedpublic void saveConsumedSubscription(@NotNull @NotNull ArtifactSubscriptionContext artifactSubscription, @NotNull @NotNull PlanResultKey planResultKey, @NotNull @NotNull String artifactLinkType)
ArtifactSubscriptionManager
saveConsumedSubscription
in interface ArtifactSubscriptionManager
@NotNull public @NotNull com.google.common.collect.Multimap<ResultsSummary,ConsumedSubscription> getConsumedSubscriptions(@NotNull @NotNull ResultsSummary resultsSummary)
ArtifactSubscriptionManager
ConsumedSubscription
ordered by order of ResultsSummary
execution.
Artifacts whose producer does not exists are appended at the end, with null key.getConsumedSubscriptions
in interface ArtifactSubscriptionManager
resultsSummary
- a job resultpublic long countSubscriptionsOfArtifact(long artifactDefinitionId)
countSubscriptionsOfArtifact
in interface ArtifactSubscriptionManager
Copyright © 2022 Atlassian Software Systems Pty Ltd. All rights reserved.