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) |
ArtifactLinkDataProvider |
getArtifactLinkDataProvider(Artifact artifact,
ArtifactHandlerConfigProvider artifactHandlerConfigProvider) |
ArtifactLinkDataProvider |
getArtifactLinkDataProvider(ArtifactLink artifactLink,
ArtifactHandlerConfigProvider artifactHandlerConfigProvider) |
Map<String,String> |
getDefaultConfiguration() |
long |
getMaxUnarchivedFilesPerArtifact(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.
|
ArtifactHandlerModuleDescriptor |
getModuleDescriptor() |
int |
getSpeed(Map<String,String> artifactHandlersConfiguration)
Return approximate transfer speed of this artifact handler in bytes per second for the specified configuration.
|
Set<AgentType> |
getSupportedAgents() |
boolean |
moveArtifactToGlobalStorage(Artifact artifact,
ArtifactHandlerConfigProvider artifactHandlerConfigProvider)
Move artifact to a 'global storage'.
|
ArtifactHandlerPublishingResult |
publish(PlanResultKey planResultKey,
ArtifactDefinitionContext artifact,
ArtifactPublishingConfig artifactPublishingConfig) |
void |
removeArtifactFromStorage(Artifact artifact,
ArtifactHandlerConfigProvider artifactHandlerConfigProvider)
Removes artifact files for a single artifact.
|
void |
removeArtifactFromStorage(PlanResultKey planResultKey,
ImmutableArtifactDefinitionBase artifact,
ArtifactHandlerConfigProvider artifactHandlerConfigProvider)
Removes artifact files for a single artifact.
|
void |
removeArtifactsFromStorage(PlanKey planKey,
ArtifactHandlerConfigProvider artifactHandlerConfigProvider)
Removes artifact files for all results of a single.
|
void |
removeArtifactsFromStorage(PlanResultKey planResultKey,
ArtifactHandlerConfigProvider artifactHandlerConfigProvider)
Removes artifact files for a single plan result.
|
ArtifactRetrievalStatus |
retrieve(ResultKey clientKey,
Artifact artifact,
ArtifactSubscriptionContext artifactSubscription,
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
@NotNull ArtifactHandlerPublishingResult publish(@NotNull PlanResultKey planResultKey, @NotNull ArtifactDefinitionContext artifact, @NotNull ArtifactPublishingConfig artifactPublishingConfig) throws Exception
Exception
@NotNull ArtifactRetrievalStatus retrieve(@NotNull ResultKey clientKey, @NotNull Artifact artifact, @NotNull ArtifactSubscriptionContext artifactSubscription, @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 ArtifactHandlerModuleDescriptor getModuleDescriptor()
boolean canHandleArtifact(ArtifactDefinitionContext artifact, Map<String,String> artifactHandlersConfiguration)
int getSpeed(@NotNull Map<String,String> artifactHandlersConfiguration)
artifactHandlersConfiguration
- artifact handler configurationLOCAL_SPEED
, LAN_SPEED
, WAN_SPEED
void removeArtifactFromStorage(@NotNull Artifact artifact, @NotNull ArtifactHandlerConfigProvider artifactHandlerConfigProvider)
void removeArtifactFromStorage(@NotNull PlanResultKey planResultKey, @NotNull ImmutableArtifactDefinitionBase artifact, @NotNull ArtifactHandlerConfigProvider artifactHandlerConfigProvider)
ArtifactLink
Should not remove artifacts that were moved to global storage.void removeArtifactsFromStorage(@NotNull PlanResultKey planResultKey, @NotNull ArtifactHandlerConfigProvider artifactHandlerConfigProvider)
ResultsSummary
Should not remove artifacts that were moved to global storage.void removeArtifactsFromStorage(@NotNull PlanKey planKey, @NotNull ArtifactHandlerConfigProvider artifactHandlerConfigProvider)
Plan
Should not remove artifacts that were moved to global storage.boolean moveArtifactToGlobalStorage(@NotNull Artifact artifact, @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 ArtifactLinkDataProvider getArtifactLinkDataProvider(ArtifactLink artifactLink, @NotNull ArtifactHandlerConfigProvider artifactHandlerConfigProvider)
@Nullable ArtifactLinkDataProvider getArtifactLinkDataProvider(Artifact artifact, @NotNull ArtifactHandlerConfigProvider artifactHandlerConfigProvider)
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. 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 © 2019 Atlassian Software Systems Pty Ltd. All rights reserved.