public class ArtifactHandlerPackagingDecorator extends ArtifactHandlerDecoratorSupport implements RepublishingArtifactHandler
A decorator for an ArtifactHandler
that adds packaging of artifact files when certain conditions are
met.
This decorator checks the ArtifactHandler.getMaxUnarchivedFilesPerArtifact(Map)
threshold when publishing
artifacts and if it is exceeded, it packages all artifact files into a single archive, which is then published
instead.
Artifacts are automatically unpacked during retrieval, which means that for artifact dependency consumers (e.g. different build stages, different build plans or deployment projects) the packaging will be transparent.
LAN_SPEED, LOCAL_SPEED, NEVER_ARCHIVE, WAN_SPEED
Constructor and Description |
---|
ArtifactHandlerPackagingDecorator(ArtifactHandler delegate) |
Modifier and Type | Method and Description |
---|---|
static com.google.common.base.Function<ArtifactHandler,ArtifactHandler> |
addFilePackaging()
A function that decorates
ArtifactHandler with conditional file packaging using ArtifactHandlerPackagingDecorator . |
protected ArtifactHandler |
delegate()
Returns the delegate instance that methods are forwarded to.
|
boolean |
isRepublishingSupported()
If republishing is really supported.
|
ArtifactHandlerPublishingResult |
publish(ResultKey resultKey,
ArtifactDefinitionContext artifact,
ArtifactPublishingConfig artifactPublishingConfig) |
ArtifactHandlerPublishingResult |
republish(ArtifactHandlerPublishingResult previousPublishingResult,
ResultKey resultKey,
ArtifactDefinitionContext artifact,
ArtifactHandlerConfigProvider artifactHandlerConfigProvider)
Method called when remote agent tries to recover from result publishing failures.
|
ArtifactRetrievalStatus |
retrieve(ResultKey clientKey,
Artifact artifact,
ArtifactSubscriptionContext artifactSubscription,
ArtifactRetrievalConfig artifactRetrievalConfig)
Retrieve arbitrary
Artifact . |
canHandleArtifact, getArtifactLinkDataProvider, getArtifactLinkDataProvider, getDefaultConfiguration, getMaxUnarchivedFilesPerArtifact, getModuleDescriptor, getSpeed, getSupportedAgents, moveArtifactToGlobalStorage, removeArtifactFromStorage, removeArtifactFromStorage, removeArtifactFromStorage, removeArtifactsFromStorage, removeArtifactsFromStorage, toString
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
canHandleArtifact, getArtifactLinkDataProvider, getArtifactLinkDataProvider, getDefaultConfiguration, getMaxUnarchivedFilesPerArtifact, getModuleDescriptor, getSpeed, getSupportedAgents, moveArtifactToGlobalStorage, publish, removeArtifactFromStorage, removeArtifactFromStorage, removeArtifactFromStorage, removeArtifactsFromStorage, removeArtifactsFromStorage
public ArtifactHandlerPackagingDecorator(@NotNull ArtifactHandler delegate)
@NotNull protected ArtifactHandler delegate()
ArtifactHandlerDecoratorSupport
delegate
in class ArtifactHandlerDecoratorSupport
@NotNull public static com.google.common.base.Function<ArtifactHandler,ArtifactHandler> addFilePackaging()
ArtifactHandler
with conditional file packaging using ArtifactHandlerPackagingDecorator
.@NotNull public ArtifactHandlerPublishingResult publish(@NotNull ResultKey resultKey, @NotNull ArtifactDefinitionContext artifact, @NotNull ArtifactPublishingConfig artifactPublishingConfig) throws Exception
publish
in interface ArtifactHandler
publish
in class ArtifactHandlerDecoratorSupport
Exception
@NotNull public ArtifactHandlerPublishingResult republish(@NotNull ArtifactHandlerPublishingResult previousPublishingResult, @NotNull ResultKey resultKey, @NotNull ArtifactDefinitionContext artifact, @NotNull ArtifactHandlerConfigProvider artifactHandlerConfigProvider) throws Exception
RepublishingArtifactHandler
ArtifactHandlerPublishingResult.Status.DEFERRED
.republish
in interface RepublishingArtifactHandler
Exception
public boolean isRepublishingSupported()
RepublishingArtifactHandler
isRepublishingSupported
in interface RepublishingArtifactHandler
@NotNull public ArtifactRetrievalStatus retrieve(@NotNull ResultKey clientKey, @NotNull Artifact artifact, @NotNull ArtifactSubscriptionContext artifactSubscription, @NotNull ArtifactRetrievalConfig artifactRetrievalConfig) throws Exception
ArtifactHandler
Artifact
. Artifact is found by the information in artifact parameter.retrieve
in interface ArtifactHandler
retrieve
in class ArtifactHandlerDecoratorSupport
clientKey
- identifier of plan or deployment doing the downloadartifact
- artifact informationartifactSubscription
- download details (e.g. target path, copy pattern)artifactRetrievalConfig
- handler specific configurationException
Copyright © 2021 Atlassian Software Systems Pty Ltd. All rights reserved.