public abstract class ArtifactHandlerDecoratorSupport extends Object implements ArtifactHandler
ArtifactHandler by overwriting some of it's methods. By default all methods are
forwarded to the underlying ArtifactHandler returned by delegate().LAN_SPEED, LOCAL_SPEED, NEVER_ARCHIVE, WAN_SPEED| Modifier | Constructor and Description |
|---|---|
protected |
ArtifactHandlerDecoratorSupport()
Constructor for use by subclasses.
|
| Modifier and Type | Method and Description |
|---|---|
boolean |
canHandleArtifact(ArtifactDefinitionContext artifact,
Map<String,String> artifactHandlersConfiguration) |
protected abstract @NotNull ArtifactHandler |
delegate()
Returns the delegate instance that methods are forwarded to.
|
@Nullable ArtifactLinkDataProvider |
getArtifactLinkDataProvider(Artifact artifact,
@NotNull ArtifactHandlerConfigProvider artifactHandlerConfigProvider) |
@Nullable ArtifactLinkDataProvider |
getArtifactLinkDataProvider(ArtifactLink artifactLink,
@NotNull ArtifactHandlerConfigProvider artifactHandlerConfigProvider) |
@NotNull Map<String,String> |
getDefaultConfiguration() |
long |
getMaxUnarchivedFilesPerArtifact(@NotNull Map<String,String> artifactHandlersConfiguration)
Returns the maximum number of files that can exist per artifact which will not be compressed and combined into
a single archive.
|
@NotNull ArtifactHandlerModuleDescriptor |
getModuleDescriptor() |
int |
getSpeed(@NotNull Map<String,String> artifactHandlersConfiguration)
Return approximate transfer speed of this artifact handler in bytes per second for the specified configuration.
|
@NotNull Set<AgentType> |
getSupportedAgents() |
boolean |
moveArtifactToGlobalStorage(@NotNull Artifact artifact,
@NotNull ArtifactHandlerConfigProvider artifactHandlerConfigProvider)
Move artifact to a 'global storage'.
|
@NotNull ArtifactHandlerPublishingResult |
publish(@NotNull ResultKey resultKey,
@NotNull ArtifactDefinitionContext artifact,
@NotNull ArtifactPublishingConfig artifactPublishingConfig,
@Nullable BuildLogger buildLogger) |
void |
removeArtifactFromStorage(@NotNull Artifact artifact,
@NotNull ArtifactHandlerConfigProvider artifactHandlerConfigProvider)
Removes artifact files for a single artifact.
|
void |
removeArtifactFromStorage(@NotNull PlanResultKey planResultKey,
@NotNull ImmutableArtifactDefinitionBase artifact,
@NotNull ArtifactHandlerConfigProvider artifactHandlerConfigProvider)
Removes artifact files for a single artifact.
|
void |
removeArtifactFromStorage(@NotNull ResultKey resultKey,
@NotNull ImmutableArtifactDefinitionBase artifact,
@NotNull ArtifactHandlerConfigProvider artifactHandlerConfigProvider)
Removes artifact files for a single artifact.
|
void |
removeArtifactsFromStorage(@NotNull PlanKey planKey,
@NotNull ArtifactHandlerConfigProvider artifactHandlerConfigProvider)
Removes artifact files for all results of a single.
|
void |
removeArtifactsFromStorage(@NotNull PlanResultKey planResultKey,
@NotNull ArtifactHandlerConfigProvider artifactHandlerConfigProvider)
Removes artifact files for a single plan result.
|
@NotNull ArtifactRetrievalStatus |
retrieve(@NotNull ResultKey clientKey,
@NotNull Artifact artifact,
@NotNull ArtifactSubscriptionContext artifactSubscription,
@NotNull ArtifactRetrievalConfig artifactRetrievalConfig)
Retrieve arbitrary
Artifact. |
String |
toString() |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, waitpublishprotected ArtifactHandlerDecoratorSupport()
@NotNull protected abstract @NotNull ArtifactHandler delegate()
@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 ArtifactHandlerException@NotNull public @NotNull ArtifactRetrievalStatus retrieve(@NotNull @NotNull ResultKey clientKey, @NotNull @NotNull Artifact artifact, @NotNull @NotNull ArtifactSubscriptionContext artifactSubscription, @NotNull @NotNull ArtifactRetrievalConfig artifactRetrievalConfig) throws Exception
ArtifactHandlerArtifact. Artifact is found by the information in artifact parameter.retrieve in interface ArtifactHandlerclientKey - identifier of plan or deployment doing the downloadartifact - artifact informationartifactSubscription - download details (e.g. target path, copy pattern)artifactRetrievalConfig - handler specific configurationException@NotNull public @NotNull Set<AgentType> getSupportedAgents()
getSupportedAgents in interface ArtifactHandler@NotNull public @NotNull ArtifactHandlerModuleDescriptor getModuleDescriptor()
getModuleDescriptor in interface ArtifactHandlerpublic boolean canHandleArtifact(ArtifactDefinitionContext artifact, Map<String,String> artifactHandlersConfiguration)
canHandleArtifact in interface ArtifactHandler@NotNull public @NotNull Map<String,String> getDefaultConfiguration()
getDefaultConfiguration in interface ArtifactHandlerpublic int getSpeed(@NotNull
@NotNull Map<String,String> artifactHandlersConfiguration)
ArtifactHandlergetSpeed in interface ArtifactHandlerartifactHandlersConfiguration - artifact handler configurationArtifactHandler.LOCAL_SPEED, ArtifactHandler.LAN_SPEED, ArtifactHandler.WAN_SPEEDpublic void removeArtifactFromStorage(@NotNull
@NotNull Artifact artifact,
@NotNull
@NotNull ArtifactHandlerConfigProvider artifactHandlerConfigProvider)
ArtifactHandlerremoveArtifactFromStorage in interface ArtifactHandlerpublic void removeArtifactFromStorage(@NotNull
@NotNull PlanResultKey planResultKey,
@NotNull
@NotNull ImmutableArtifactDefinitionBase artifact,
@NotNull
@NotNull ArtifactHandlerConfigProvider artifactHandlerConfigProvider)
ArtifactHandlerArtifactLink
Should not remove artifacts that were moved to global storage.removeArtifactFromStorage in interface ArtifactHandlerpublic void removeArtifactFromStorage(@NotNull
@NotNull ResultKey resultKey,
@NotNull
@NotNull ImmutableArtifactDefinitionBase artifact,
@NotNull
@NotNull ArtifactHandlerConfigProvider artifactHandlerConfigProvider)
ArtifactHandlerArtifactLink
Should not remove artifacts that were moved to global storage.removeArtifactFromStorage in interface ArtifactHandlerpublic void removeArtifactsFromStorage(@NotNull
@NotNull PlanResultKey planResultKey,
@NotNull
@NotNull ArtifactHandlerConfigProvider artifactHandlerConfigProvider)
ArtifactHandlerResultsSummary
Should not remove artifacts that were moved to global storage.removeArtifactsFromStorage in interface ArtifactHandlerpublic void removeArtifactsFromStorage(@NotNull
@NotNull PlanKey planKey,
@NotNull
@NotNull ArtifactHandlerConfigProvider artifactHandlerConfigProvider)
ArtifactHandlerPlan
Should not remove artifacts that were moved to global storage.removeArtifactsFromStorage in interface ArtifactHandlerpublic boolean moveArtifactToGlobalStorage(@NotNull
@NotNull Artifact artifact,
@NotNull
@NotNull ArtifactHandlerConfigProvider artifactHandlerConfigProvider)
throws IOException
ArtifactHandlerArtifactHandler.removeArtifactFromStorage(Artifact, ArtifactHandlerConfigProvider) is called.
It is not a requirement to physically move the files as long as the above contract is fulfilled.moveArtifactToGlobalStorage in interface ArtifactHandlerIOException@Nullable public @Nullable ArtifactLinkDataProvider getArtifactLinkDataProvider(ArtifactLink artifactLink, @NotNull @NotNull ArtifactHandlerConfigProvider artifactHandlerConfigProvider)
getArtifactLinkDataProvider in interface ArtifactHandler@Nullable public @Nullable ArtifactLinkDataProvider getArtifactLinkDataProvider(Artifact artifact, @NotNull @NotNull ArtifactHandlerConfigProvider artifactHandlerConfigProvider)
getArtifactLinkDataProvider in interface ArtifactHandlerpublic long getMaxUnarchivedFilesPerArtifact(@NotNull
@NotNull Map<String,String> artifactHandlersConfiguration)
ArtifactHandlerReturns the maximum number of files that can exist per artifact which will not be compressed and combined into a single archive. If the threshold is exceeded, artifacts will be packaged into a single file before publishing.
ArtifactHandler does not need to treat archived artifacts differently - from ArtifactHandler
perspective the packaging is transparent. Artifact files will be compressed before invoking #publish method and
decompressed after invoking #retrieve method.
This method should return ArtifactHandler.NEVER_ARCHIVE if packaging of artifacts is disabled, to always send files
unarchived.
getMaxUnarchivedFilesPerArtifact in interface ArtifactHandlerartifactHandlersConfiguration - artifact handler configurationCopyright © 2022 Atlassian Software Systems Pty Ltd. All rights reserved.