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(@NotNull ArtifactHandler delegate) |
Modifier and Type | Method and Description |
---|---|
static @NotNull com.google.common.base.Function<ArtifactHandler,ArtifactHandler> |
addFilePackaging()
A function that decorates
ArtifactHandler with conditional file packaging using ArtifactHandlerPackagingDecorator . |
protected @NotNull ArtifactHandler |
delegate()
Returns the delegate instance that methods are forwarded to.
|
boolean |
isRepublishingSupported()
If republishing is really supported.
|
@NotNull ArtifactHandlerPublishingResult |
publish(@NotNull ResultKey resultKey,
@NotNull ArtifactDefinitionContext artifact,
@NotNull ArtifactPublishingConfig artifactPublishingConfig,
@Nullable BuildLogger buildLogger) |
@NotNull ArtifactHandlerPublishingResult |
republish(@NotNull ArtifactHandlerPublishingResult previousPublishingResult,
@NotNull ResultKey resultKey,
@NotNull ArtifactDefinitionContext artifact,
@NotNull ArtifactHandlerConfigProvider artifactHandlerConfigProvider,
@Nullable BuildLogger buildLogger)
Method called when remote agent tries to recover from result publishing failures.
|
@NotNull ArtifactRetrievalStatus |
retrieve(@NotNull ResultKey clientKey,
@NotNull Artifact artifact,
@NotNull ArtifactSubscriptionContext artifactSubscription,
@NotNull 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
republish
canHandleArtifact, getArtifactLinkDataProvider, getArtifactLinkDataProvider, getDefaultConfiguration, getMaxUnarchivedFilesPerArtifact, getModuleDescriptor, getSpeed, getSupportedAgents, moveArtifactToGlobalStorage, publish, removeArtifactFromStorage, removeArtifactFromStorage, removeArtifactFromStorage, removeArtifactsFromStorage, removeArtifactsFromStorage
public ArtifactHandlerPackagingDecorator(@NotNull @NotNull ArtifactHandler delegate)
@NotNull protected @NotNull ArtifactHandler delegate()
ArtifactHandlerDecoratorSupport
delegate
in class ArtifactHandlerDecoratorSupport
@NotNull public static @NotNull com.google.common.base.Function<ArtifactHandler,ArtifactHandler> addFilePackaging()
ArtifactHandler
with conditional file packaging using ArtifactHandlerPackagingDecorator
.@NotNull public @NotNull ArtifactHandlerPublishingResult publish(@NotNull @NotNull ResultKey resultKey, @NotNull @NotNull ArtifactDefinitionContext artifact, @NotNull @NotNull ArtifactPublishingConfig artifactPublishingConfig, @Nullable @Nullable BuildLogger buildLogger) throws Exception
publish
in interface ArtifactHandler
publish
in class ArtifactHandlerDecoratorSupport
Exception
@NotNull public @NotNull ArtifactHandlerPublishingResult republish(@NotNull @NotNull ArtifactHandlerPublishingResult previousPublishingResult, @NotNull @NotNull ResultKey resultKey, @NotNull @NotNull ArtifactDefinitionContext artifact, @NotNull @NotNull ArtifactHandlerConfigProvider artifactHandlerConfigProvider, @Nullable @Nullable BuildLogger buildLogger) throws Exception
RepublishingArtifactHandler
ArtifactHandlerPublishingResult.Status.DEFERRED
.republish
in interface RepublishingArtifactHandler
Exception
public boolean isRepublishingSupported()
RepublishingArtifactHandler
isRepublishingSupported
in interface RepublishingArtifactHandler
@NotNull public @NotNull ArtifactRetrievalStatus retrieve(@NotNull @NotNull ResultKey clientKey, @NotNull @NotNull Artifact artifact, @NotNull @NotNull ArtifactSubscriptionContext artifactSubscription, @NotNull @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 © 2022 Atlassian Software Systems Pty Ltd. All rights reserved.