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) |
List<ArtifactSubscription> |
findCurrentSubscriptionsForPlan(ImmutableJob producerJob)
Get list of subscriptions existing in a chain for given artifact
|
ArtifactSubscription |
findSubscription(long id)
Get artifact definition of specified id
|
List<ArtifactSubscription> |
findSubscriptionsOfPlan(PlanIdentifier plan)
Get list of artifact subscriptions associated with a plan
|
List<ArtifactDefinition> |
findSubscriptionsPossibleForPlan(ImmutableJob 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,
String stageName)
Shorter for of validateSubscriptions method
|
List<ArtifactDefinitionContext> |
prepareArtifactDefinitionContexts(ImmutableJob job,
BuildContext buildContext,
SecureToken secureToken)
Helps prepare the artifact definitions
|
List<ArtifactSubscriptionContext> |
prepareSubscriptionContexts(ImmutableJob job,
BuildContext parentBuildContext,
SecureToken secureToken) |
void |
removeArtifactSubscription(ArtifactSubscription artifactSubscription)
Remove artifact subscription.
|
void |
removeArtifactSubscriptions(Collection<ArtifactSubscription> artifactSubscriptions)
Remove all artifact subscriptions in the collection.
|
void |
removeArtifactSubscriptionsOfPlan(ImmutablePlan plan)
Remove all artifact subscriptions for a plan
|
void |
removeArtifactSubscriptionsOfPlan(Plan plan)
Remove all artifact subscriptions for a plan
|
void |
saveArtifactSubscription(ArtifactSubscription artifactSubscription)
Save artifact subscription.
|
void |
saveArtifactSubscriptions(Collection<ArtifactSubscription> artifactSubscriptions)
Save all artifact definitions in a collection.
|
void |
saveConsumedSubscription(ArtifactSubscriptionContext artifactSubscription,
PlanResultKey planResultKey,
String artifactLinkType)
Store consumed subscription.
|
List<ArtifactSubscriptionSubstitutionAware> |
transformSubscriptions(List<ArtifactSubscription> subscriptions) |
List<ArtifactSubscription> |
validateSubscribersForMovedJob(ImmutableJob producer,
ImmutableChainStage destinationStage)
Validate all consumer artifact subscriptions to the artifacts produced by a Job against target stage
|
List<ArtifactSubscription> |
validateSubscriptions(ImmutableJob consumer,
ImmutableChain chain,
String stageName)
Validate consumer artifact subscriptions against target chain and stage
|
List<ArtifactSubscription> |
validateSubscriptionsForMovedJob(ImmutableJob job,
ImmutableChainStage targetStage)
Validate all artifact subscriptions possibly affected by moving a job.
|
List<ArtifactSubscription> |
validateSubscriptionsForMovedStage(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 List<ArtifactSubscription> findSubscriptionsOfPlan(@NotNull PlanIdentifier plan)
ArtifactSubscriptionManager
findSubscriptionsOfPlan
in interface ArtifactSubscriptionManager
plan
- plan which associated artifact subscriptions should be retrievedpublic List<ArtifactSubscriptionSubstitutionAware> transformSubscriptions(@NotNull List<ArtifactSubscription> subscriptions)
transformSubscriptions
in interface ArtifactSubscriptionManager
@NotNull public List<ArtifactDefinition> findSubscriptionsPossibleForPlan(@NotNull ImmutableJob job)
ArtifactSubscriptionManager
findSubscriptionsPossibleForPlan
in interface ArtifactSubscriptionManager
@NotNull public List<ArtifactSubscription> findCurrentSubscriptionsForPlan(@NotNull ImmutableJob producerJob)
ArtifactSubscriptionManager
findCurrentSubscriptionsForPlan
in interface ArtifactSubscriptionManager
@NotNull public List<ArtifactSubscription> validateSubscribersForMovedJob(@NotNull ImmutableJob producer, @NotNull ImmutableChainStage destinationStage)
ArtifactSubscriptionManager
validateSubscribersForMovedJob
in interface ArtifactSubscriptionManager
producer
- job being producer of the artifactsdestinationStage
- target stage@NotNull public List<ArtifactSubscription> validateSubscriptions(@NotNull ImmutableJob consumer, @NotNull ImmutableChain chain, @NotNull String stageName)
ArtifactSubscriptionManager
validateSubscriptions
in interface ArtifactSubscriptionManager
consumer
- job being consumer of artifact definitionschain
- target chainstageName
- target stage@NotNull public List<ArtifactSubscription> validateSubscriptionsForMovedJob(@NotNull ImmutableJob job, @NotNull ImmutableChainStage targetStage)
ArtifactSubscriptionManager
validateSubscriptionsForMovedJob
in interface ArtifactSubscriptionManager
job
- job being movedtargetStage
- target stageArtifactSubscription
that won't qualify after the move@NotNull public List<ArtifactSubscription> validateSubscriptionsForMovedStage(@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 Job consumer, @NotNull Chain chain, @NotNull String stageName)
ArtifactSubscriptionManager
isSubscriptionsValid
in interface ArtifactSubscriptionManager
consumer
- job being consumer of artifact definitionschain
- target chainstageName
- target stage@NotNull public List<ArtifactSubscriptionContext> prepareSubscriptionContexts(@NotNull ImmutableJob job, @NotNull BuildContext parentBuildContext, SecureToken secureToken)
prepareSubscriptionContexts
in interface ArtifactSubscriptionManager
@NotNull public List<ArtifactDefinitionContext> prepareArtifactDefinitionContexts(@NotNull ImmutableJob job, @NotNull BuildContext buildContext, SecureToken secureToken)
ArtifactSubscriptionManager
prepareArtifactDefinitionContexts
in interface ArtifactSubscriptionManager
public void removeArtifactSubscription(@NotNull ArtifactSubscription artifactSubscription)
ArtifactSubscriptionManager
removeArtifactSubscription
in interface ArtifactSubscriptionManager
artifactSubscription
- ArtifactSubscription
to be removedpublic void removeArtifactSubscriptions(@NotNull Collection<ArtifactSubscription> artifactSubscriptions)
ArtifactSubscriptionManager
removeArtifactSubscriptions
in interface ArtifactSubscriptionManager
artifactSubscriptions
- collection of ArtifactSubscription
to be removedpublic void removeArtifactSubscriptionsOfPlan(@NotNull Plan plan)
ArtifactSubscriptionManager
removeArtifactSubscriptionsOfPlan
in interface ArtifactSubscriptionManager
public void removeArtifactSubscriptionsOfPlan(@NotNull ImmutablePlan plan)
ArtifactSubscriptionManager
removeArtifactSubscriptionsOfPlan
in interface ArtifactSubscriptionManager
public void saveArtifactSubscription(@NotNull ArtifactSubscription artifactSubscription)
ArtifactSubscriptionManager
saveArtifactSubscription
in interface ArtifactSubscriptionManager
artifactSubscription
- object to be savedpublic void saveArtifactSubscriptions(@NotNull Collection<ArtifactSubscription> artifactSubscriptions)
ArtifactSubscriptionManager
saveArtifactSubscriptions
in interface ArtifactSubscriptionManager
artifactSubscriptions
- collection of objects to be saved/updatedpublic void saveConsumedSubscription(@NotNull ArtifactSubscriptionContext artifactSubscription, @NotNull PlanResultKey planResultKey, @NotNull String artifactLinkType)
ArtifactSubscriptionManager
saveConsumedSubscription
in interface ArtifactSubscriptionManager
@NotNull public com.google.common.collect.Multimap<ResultsSummary,ConsumedSubscription> getConsumedSubscriptions(@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 © 2021 Atlassian Software Systems Pty Ltd. All rights reserved.