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 ArtifactHandler |
delegate()
Returns the delegate instance that methods are forwarded to.
|
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 . |
String |
toString() |
protected ArtifactHandlerDecoratorSupport()
@NotNull protected abstract ArtifactHandler delegate()
@NotNull public ArtifactHandlerPublishingResult publish(@NotNull PlanResultKey planResultKey, @NotNull ArtifactDefinitionContext artifact, @NotNull ArtifactPublishingConfig artifactPublishingConfig) throws Exception
publish
in interface ArtifactHandler
Exception
@NotNull public ArtifactRetrievalStatus retrieve(@NotNull ResultKey clientKey, @NotNull Artifact artifact, @NotNull ArtifactSubscriptionContext artifactSubscription, @NotNull ArtifactRetrievalConfig artifactRetrievalConfig) throws Exception
ArtifactHandler
Artifact
. Artifact is found by the information in artifact parameter.retrieve
in interface ArtifactHandler
clientKey
- identifier of plan or deployment doing the downloadartifact
- artifact informationartifactSubscription
- download details (e.g. target path, copy pattern)artifactRetrievalConfig
- handler specific configurationException
@NotNull public Set<AgentType> getSupportedAgents()
getSupportedAgents
in interface ArtifactHandler
@NotNull public ArtifactHandlerModuleDescriptor getModuleDescriptor()
getModuleDescriptor
in interface ArtifactHandler
public boolean canHandleArtifact(ArtifactDefinitionContext artifact, Map<String,String> artifactHandlersConfiguration)
canHandleArtifact
in interface ArtifactHandler
@NotNull public Map<String,String> getDefaultConfiguration()
getDefaultConfiguration
in interface ArtifactHandler
public int getSpeed(@NotNull Map<String,String> artifactHandlersConfiguration)
ArtifactHandler
getSpeed
in interface ArtifactHandler
artifactHandlersConfiguration
- artifact handler configurationArtifactHandler.LOCAL_SPEED
, ArtifactHandler.LAN_SPEED
, ArtifactHandler.WAN_SPEED
public void removeArtifactFromStorage(@NotNull Artifact artifact, @NotNull ArtifactHandlerConfigProvider artifactHandlerConfigProvider)
ArtifactHandler
removeArtifactFromStorage
in interface 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.removeArtifactFromStorage
in interface ArtifactHandler
public void removeArtifactsFromStorage(@NotNull PlanResultKey planResultKey, @NotNull ArtifactHandlerConfigProvider artifactHandlerConfigProvider)
ArtifactHandler
ResultsSummary
Should not remove artifacts that were moved to global storage.removeArtifactsFromStorage
in interface ArtifactHandler
public void removeArtifactsFromStorage(@NotNull PlanKey planKey, @NotNull ArtifactHandlerConfigProvider artifactHandlerConfigProvider)
ArtifactHandler
Plan
Should not remove artifacts that were moved to global storage.removeArtifactsFromStorage
in interface ArtifactHandler
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.moveArtifactToGlobalStorage
in interface ArtifactHandler
IOException
@Nullable public ArtifactLinkDataProvider getArtifactLinkDataProvider(ArtifactLink artifactLink, @NotNull ArtifactHandlerConfigProvider artifactHandlerConfigProvider)
getArtifactLinkDataProvider
in interface ArtifactHandler
@Nullable public ArtifactLinkDataProvider getArtifactLinkDataProvider(Artifact artifact, @NotNull ArtifactHandlerConfigProvider artifactHandlerConfigProvider)
getArtifactLinkDataProvider
in interface ArtifactHandler
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
artifactHandlersConfiguration
- artifact handler configurationCopyright © 2019 Atlassian Software Systems Pty Ltd. All rights reserved.