public class S3ArtifactHandler extends AbstractArtifactHandler
Modifier and Type | Field and Description |
---|---|
static int |
AWS_BULK_DELETE_LIMIT |
ALL_AGENT_TYPES, LOCAL_AGENTS, NON_LOCAL_AGENTS
LAN_SPEED, LOCAL_SPEED, NEVER_ARCHIVE, WAN_SPEED
Constructor and Description |
---|
S3ArtifactHandler() |
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) |
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.
|
int |
getSpeed(Map<String,String> artifactHandlersConfiguration)
Return approximate transfer speed of this artifact handler in bytes per second for the specified configuration.
|
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 . |
configProvider, configProvider, getConfigurationKey, getConfigValue, getDefaultConfiguration, getModuleDescriptor, getSupportedAgents, init
public static final int AWS_BULK_DELETE_LIMIT
@NotNull public ArtifactHandlerPublishingResult publish(@NotNull PlanResultKey planResultKey, @NotNull ArtifactDefinitionContext artifact, @NotNull ArtifactPublishingConfig artifactPublishingConfig) throws IOException
IOException
public boolean canHandleArtifact(ArtifactDefinitionContext artifact, Map<String,String> artifactHandlersConfiguration)
canHandleArtifact
in interface ArtifactHandler
canHandleArtifact
in class AbstractArtifactHandler
public boolean moveArtifactToGlobalStorage(@NotNull Artifact artifact, @NotNull ArtifactHandlerConfigProvider artifactHandlerConfigProvider) throws IOException
ArtifactHandler
ArtifactHandler.removeArtifactFromStorage(Artifact, ArtifactHandlerConfigProvider)
is called.
It is not a requirement to physically move the files as long as the above contract is fulfilled.IOException
@NotNull public ArtifactRetrievalStatus retrieve(@NotNull ResultKey clientKey, @NotNull Artifact artifact, @NotNull ArtifactSubscriptionContext artifactSubscription, @NotNull ArtifactRetrievalConfig artifactRetrievalConfig) throws IOException
ArtifactHandler
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 configurationIOException
public int getSpeed(@NotNull Map<String,String> artifactHandlersConfiguration)
ArtifactHandler
artifactHandlersConfiguration
- artifact handler configurationArtifactHandler.LOCAL_SPEED
, ArtifactHandler.LAN_SPEED
, ArtifactHandler.WAN_SPEED
public void removeArtifactFromStorage(@NotNull Artifact artifact, @NotNull ArtifactHandlerConfigProvider artifactHandlerConfigProvider)
ArtifactHandler
public void removeArtifactFromStorage(@NotNull PlanResultKey planResultKey, @NotNull ImmutableArtifactDefinitionBase artifact, @NotNull ArtifactHandlerConfigProvider artifactHandlerConfigProvider)
ArtifactHandler
ArtifactLink
Should not remove artifacts that were moved to global storage.public void removeArtifactsFromStorage(@NotNull PlanResultKey planResultKey, @NotNull ArtifactHandlerConfigProvider artifactHandlerConfigProvider)
ArtifactHandler
ResultsSummary
Should not remove artifacts that were moved to global storage.public void removeArtifactsFromStorage(@NotNull PlanKey planKey, @NotNull ArtifactHandlerConfigProvider artifactHandlerConfigProvider)
ArtifactHandler
Plan
Should not remove artifacts that were moved to global storage.public ArtifactLinkDataProvider getArtifactLinkDataProvider(ArtifactLink artifactLink, @NotNull ArtifactHandlerConfigProvider artifactHandlerConfigProvider)
@Nullable public ArtifactLinkDataProvider getArtifactLinkDataProvider(Artifact artifact, @NotNull ArtifactHandlerConfigProvider artifactHandlerConfigProvider)
public long getMaxUnarchivedFilesPerArtifact(@NotNull Map<String,String> artifactHandlersConfiguration)
ArtifactHandler
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 ArtifactHandler.NEVER_ARCHIVE
if packaging of artifacts is disabled, to always send files
unarchived.
getMaxUnarchivedFilesPerArtifact
in interface ArtifactHandler
getMaxUnarchivedFilesPerArtifact
in class AbstractArtifactHandler
artifactHandlersConfiguration
- artifact handler configurationCopyright © 2017 Atlassian Software Systems Pty Ltd. All rights reserved.