Class AbstractLocalArtifactHandler
java.lang.Object
com.atlassian.bamboo.build.artifact.AbstractArtifactHandler
com.atlassian.bamboo.build.artifact.AbstractLocalArtifactHandler
- All Implemented Interfaces:
ArtifactHandler
,InitablePluginModule<ArtifactHandlerModuleDescriptor>
,BambooPluginModule
- Direct Known Subclasses:
AgentLocalArtifactHandler
,RemoteTransferFallbackArtifactHandler
,ServerLocalArtifactHandler
-
Field Summary
Fields inherited from class com.atlassian.bamboo.build.artifact.AbstractArtifactHandler
ALL_AGENT_TYPES, LOCAL_AGENTS, NON_LOCAL_AGENTS
Fields inherited from interface com.atlassian.bamboo.build.artifact.ArtifactHandler
LAN_SPEED, LOCAL_SPEED, NEVER_ARCHIVE, WAN_SPEED
-
Constructor Summary
-
Method Summary
Modifier and TypeMethodDescriptionprotected abstract ArtifactDirectoryBuilder
getArtifactDirectoryBuilder
(ArtifactHandlerConfigProvider artifactHandlerConfigProvider) getArtifactLinkDataProvider
(Artifact artifact, @NotNull ArtifactHandlerConfigProvider artifactHandlerConfigProvider) getArtifactLinkDataProvider
(ArtifactLink artifactLink, @NotNull ArtifactHandlerConfigProvider artifactHandlerConfigProvider) protected File
getArtifactStorageDirectory
(Artifact artifact, ArtifactHandlerConfigProvider artifactHandlerConfigProvider) protected File
getArtifactStorageDirectory
(ResultKey resultKey, ArtifactDefinitionContext artifact, ArtifactHandlerConfigProvider artifactHandlerConfigProvider) int
Return approximate transfer speed of this artifact handler in bytes per second for the specified configuration.boolean
moveArtifactToGlobalStorage
(@NotNull Artifact artifact, @NotNull ArtifactHandlerConfigProvider artifactHandlerConfigProvider) Move artifact to a 'global storage'.@NotNull ArtifactHandlerPublishingResult
publish
(@NotNull ResultKey planResultKey, @NotNull ArtifactDefinitionContext artifact, @NotNull ArtifactPublishingConfig artifactPublishingConfig, @NotNull BuildLogger buildLogger) void
removeAllArtifactsOfChain
(@NotNull PlanKey planKey, @NotNull ArtifactHandlerConfigProvider artifactHandlerConfigProvider) Removes artifact files for all results of a single chain.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 planResultKey, @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 chain or job.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 arbitraryArtifact
.Methods inherited from class com.atlassian.bamboo.build.artifact.AbstractArtifactHandler
canHandleArtifact, configProvider, configProvider, getConfigurationKey, getConfigValue, getDefaultConfiguration, getMaxUnarchivedFilesPerArtifact, getModuleDescriptor, getSupportedAgents, init
-
Constructor Details
-
AbstractLocalArtifactHandler
-
-
Method Details
-
publish
@NotNull public @NotNull ArtifactHandlerPublishingResult publish(@NotNull @NotNull ResultKey planResultKey, @NotNull @NotNull ArtifactDefinitionContext artifact, @NotNull @NotNull ArtifactPublishingConfig artifactPublishingConfig, @NotNull @NotNull BuildLogger buildLogger) throws IOException - Throws:
IOException
-
retrieve
@NotNull public @NotNull ArtifactRetrievalStatus retrieve(@NotNull @NotNull ResultKey clientKey, @NotNull @NotNull Artifact artifact, @NotNull @NotNull ArtifactSubscriptionContext artifactSubscription, @NotNull @NotNull ArtifactRetrievalConfig artifactRetrievalConfig) throws IOException Description copied from interface:ArtifactHandler
Retrieve arbitraryArtifact
. Artifact is found by the information in artifact parameter.- Parameters:
clientKey
- identifier of plan or deployment doing the downloadartifact
- artifact informationartifactSubscription
- download details (e.g. target path, copy pattern)artifactRetrievalConfig
- handler specific configuration- Throws:
IOException
-
getArtifactStorageDirectory
protected File getArtifactStorageDirectory(ResultKey resultKey, ArtifactDefinitionContext artifact, ArtifactHandlerConfigProvider artifactHandlerConfigProvider) -
getArtifactStorageDirectory
protected File getArtifactStorageDirectory(Artifact artifact, ArtifactHandlerConfigProvider artifactHandlerConfigProvider) -
getArtifactDirectoryBuilder
protected abstract ArtifactDirectoryBuilder getArtifactDirectoryBuilder(ArtifactHandlerConfigProvider artifactHandlerConfigProvider) -
getSpeed
Description copied from interface:ArtifactHandler
Return approximate transfer speed of this artifact handler in bytes per second for the specified configuration. Result of this method might be taken into account when deciding which artifact handler to use if multiple handlers are enabled.- Parameters:
artifactHandlersConfiguration
- artifact handler configuration- Returns:
- approximate transfer speed in Bps, for example:
ArtifactHandler.LOCAL_SPEED
,ArtifactHandler.LAN_SPEED
,ArtifactHandler.WAN_SPEED
-
removeArtifactFromStorage
public void removeArtifactFromStorage(@NotNull @NotNull Artifact artifact, @NotNull @NotNull ArtifactHandlerConfigProvider artifactHandlerConfigProvider) Description copied from interface:ArtifactHandler
Removes artifact files for a single artifact. -
removeArtifactFromStorage
public void removeArtifactFromStorage(@NotNull @NotNull PlanResultKey planResultKey, @NotNull @NotNull ImmutableArtifactDefinitionBase artifact, @NotNull @NotNull ArtifactHandlerConfigProvider artifactHandlerConfigProvider) Description copied from interface:ArtifactHandler
Removes artifact files for a single artifact. Called when removingArtifactLink
Should not remove artifacts that were moved to global storage. -
removeArtifactFromStorage
public void removeArtifactFromStorage(@NotNull @NotNull ResultKey planResultKey, @NotNull @NotNull ImmutableArtifactDefinitionBase artifact, @NotNull @NotNull ArtifactHandlerConfigProvider artifactHandlerConfigProvider) Description copied from interface:ArtifactHandler
Removes artifact files for a single artifact. Called when removingArtifactLink
Should not remove artifacts that were moved to global storage. -
removeArtifactsFromStorage
public void removeArtifactsFromStorage(@NotNull @NotNull PlanResultKey planResultKey, @NotNull @NotNull ArtifactHandlerConfigProvider artifactHandlerConfigProvider) Description copied from interface:ArtifactHandler
Removes artifact files for a single plan result. Called when removingResultsSummary
Should not remove artifacts that were moved to global storage. -
removeArtifactsFromStorage
public void removeArtifactsFromStorage(@NotNull @NotNull PlanKey planKey, @NotNull @NotNull ArtifactHandlerConfigProvider artifactHandlerConfigProvider) Description copied from interface:ArtifactHandler
Removes artifact files for all results of a single chain or job. Called when removingPlan
Calling it for chain removes only the shared artifacts. Should not remove artifacts that were moved to global storage. -
removeAllArtifactsOfChain
public void removeAllArtifactsOfChain(@NotNull @NotNull PlanKey planKey, @NotNull @NotNull ArtifactHandlerConfigProvider artifactHandlerConfigProvider) Description copied from interface:ArtifactHandler
Removes artifact files for all results of a single chain. Called when removingChain
Should not remove artifacts that were moved to global storage. -
moveArtifactToGlobalStorage
public boolean moveArtifactToGlobalStorage(@NotNull @NotNull Artifact artifact, @NotNull @NotNull ArtifactHandlerConfigProvider artifactHandlerConfigProvider) Description copied from interface:ArtifactHandler
Move artifact to a 'global storage'. Artifacts in 'global storage' should only be removed whenArtifactHandler.removeArtifactFromStorage(Artifact, ArtifactHandlerConfigProvider)
is called. It is not a requirement to physically move the files as long as the above contract is fulfilled.- Returns:
- true if move successful
-
getArtifactLinkDataProvider
public ArtifactLinkDataProvider getArtifactLinkDataProvider(ArtifactLink artifactLink, @NotNull @NotNull ArtifactHandlerConfigProvider artifactHandlerConfigProvider) -
getArtifactLinkDataProvider
public ArtifactLinkDataProvider getArtifactLinkDataProvider(Artifact artifact, @NotNull @NotNull ArtifactHandlerConfigProvider artifactHandlerConfigProvider)
-