public interface ArtifactHandler extends BambooPluginModule
Modifier and Type | Field and Description |
---|---|
static int |
LAN_SPEED |
static int |
LOCAL_SPEED |
static long |
NEVER_ARCHIVE
A value to be used within
getMaxUnarchivedFilesPerArtifact(Map) to completely disable
archiving of artifacts. |
static int |
WAN_SPEED |
Modifier and Type | Method and Description |
---|---|
boolean |
canHandleArtifact(ArtifactDefinitionContext artifact,
Map<String,String> artifactHandlersConfiguration) |
@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'.
|
default @NotNull ArtifactHandlerPublishingResult |
publish(@NotNull ResultKey resultKey,
@NotNull ArtifactDefinitionContext artifact,
@NotNull ArtifactPublishingConfig artifactPublishingConfig)
Deprecated.
|
@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 . |
static final long NEVER_ARCHIVE
getMaxUnarchivedFilesPerArtifact(Map)
to completely disable
archiving of artifacts.static final int LOCAL_SPEED
static final int LAN_SPEED
static final int WAN_SPEED
@Deprecated @NotNull default @NotNull ArtifactHandlerPublishingResult publish(@NotNull @NotNull ResultKey resultKey, @NotNull @NotNull ArtifactDefinitionContext artifact, @NotNull @NotNull ArtifactPublishingConfig artifactPublishingConfig) throws Exception
publish(ResultKey, ArtifactDefinitionContext, ArtifactPublishingConfig, BuildLogger)
Exception
@NotNull @NotNull ArtifactHandlerPublishingResult publish(@NotNull @NotNull ResultKey resultKey, @NotNull @NotNull ArtifactDefinitionContext artifact, @NotNull @NotNull ArtifactPublishingConfig artifactPublishingConfig, @Nullable @Nullable BuildLogger buildLogger) throws Exception
Exception
@NotNull @NotNull ArtifactRetrievalStatus retrieve(@NotNull @NotNull ResultKey clientKey, @NotNull @NotNull Artifact artifact, @NotNull @NotNull ArtifactSubscriptionContext artifactSubscription, @NotNull @NotNull ArtifactRetrievalConfig artifactRetrievalConfig) throws Exception
Artifact
. Artifact is found by the information in artifact parameter.clientKey
- identifier of plan or deployment doing the downloadartifact
- artifact informationartifactSubscription
- download details (e.g. target path, copy pattern)artifactRetrievalConfig
- handler specific configurationException
@NotNull @NotNull ArtifactHandlerModuleDescriptor getModuleDescriptor()
boolean canHandleArtifact(ArtifactDefinitionContext artifact, Map<String,String> artifactHandlersConfiguration)
int getSpeed(@NotNull @NotNull Map<String,String> artifactHandlersConfiguration)
artifactHandlersConfiguration
- artifact handler configurationLOCAL_SPEED
, LAN_SPEED
, WAN_SPEED
void removeArtifactFromStorage(@NotNull @NotNull Artifact artifact, @NotNull @NotNull ArtifactHandlerConfigProvider artifactHandlerConfigProvider)
void removeArtifactFromStorage(@NotNull @NotNull PlanResultKey planResultKey, @NotNull @NotNull ImmutableArtifactDefinitionBase artifact, @NotNull @NotNull ArtifactHandlerConfigProvider artifactHandlerConfigProvider)
ArtifactLink
Should not remove artifacts that were moved to global storage.void removeArtifactFromStorage(@NotNull @NotNull ResultKey resultKey, @NotNull @NotNull ImmutableArtifactDefinitionBase artifact, @NotNull @NotNull ArtifactHandlerConfigProvider artifactHandlerConfigProvider)
ArtifactLink
Should not remove artifacts that were moved to global storage.void removeArtifactsFromStorage(@NotNull @NotNull PlanResultKey planResultKey, @NotNull @NotNull ArtifactHandlerConfigProvider artifactHandlerConfigProvider)
ResultsSummary
Should not remove artifacts that were moved to global storage.void removeArtifactsFromStorage(@NotNull @NotNull PlanKey planKey, @NotNull @NotNull ArtifactHandlerConfigProvider artifactHandlerConfigProvider)
Plan
Should not remove artifacts that were moved to global storage.boolean moveArtifactToGlobalStorage(@NotNull @NotNull Artifact artifact, @NotNull @NotNull ArtifactHandlerConfigProvider artifactHandlerConfigProvider) throws IOException
removeArtifactFromStorage(Artifact, ArtifactHandlerConfigProvider)
is called.
It is not a requirement to physically move the files as long as the above contract is fulfilled.artifact
- IOException
@Nullable @Nullable ArtifactLinkDataProvider getArtifactLinkDataProvider(ArtifactLink artifactLink, @NotNull @NotNull ArtifactHandlerConfigProvider artifactHandlerConfigProvider)
@Nullable @Nullable ArtifactLinkDataProvider getArtifactLinkDataProvider(Artifact artifact, @NotNull @NotNull ArtifactHandlerConfigProvider artifactHandlerConfigProvider)
long getMaxUnarchivedFilesPerArtifact(@NotNull @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. 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 NEVER_ARCHIVE
if packaging of artifacts is disabled, to always send files
unarchived.
artifactHandlersConfiguration
- artifact handler configurationCopyright © 2022 Atlassian Software Systems Pty Ltd. All rights reserved.