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
public abstract class AbstractLocalArtifactHandler extends AbstractArtifactHandler
-
-
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
Constructors Constructor Description AbstractLocalArtifactHandler(Set<AgentType> supportedAgents)
-
Method Summary
All Methods Instance Methods Abstract Methods Concrete Methods Modifier and Type Method Description protected abstract ArtifactDirectoryBuildergetArtifactDirectoryBuilder(ArtifactHandlerConfigProvider artifactHandlerConfigProvider)ArtifactLinkDataProvidergetArtifactLinkDataProvider(Artifact artifact, @NotNull ArtifactHandlerConfigProvider artifactHandlerConfigProvider)ArtifactLinkDataProvidergetArtifactLinkDataProvider(ArtifactLink artifactLink, @NotNull ArtifactHandlerConfigProvider artifactHandlerConfigProvider)protected FilegetArtifactStorageDirectory(Artifact artifact, ArtifactHandlerConfigProvider artifactHandlerConfigProvider)protected FilegetArtifactStorageDirectory(ResultKey resultKey, ArtifactDefinitionContext artifact, ArtifactHandlerConfigProvider artifactHandlerConfigProvider)intgetSpeed(@NotNull Map<String,String> artifactHandlersConfiguration)Return approximate transfer speed of this artifact handler in bytes per second for the specified configuration.booleanmoveArtifactToGlobalStorage(@NotNull Artifact artifact, @NotNull ArtifactHandlerConfigProvider artifactHandlerConfigProvider)Move artifact to a 'global storage'.@NotNull ArtifactHandlerPublishingResultpublish(@NotNull ResultKey planResultKey, @NotNull ArtifactDefinitionContext artifact, @NotNull ArtifactPublishingConfig artifactPublishingConfig, @NotNull BuildLogger buildLogger)voidremoveAllArtifactsOfChain(@NotNull PlanKey planKey, @NotNull ArtifactHandlerConfigProvider artifactHandlerConfigProvider)Removes artifact files for all results of a single chain.voidremoveArtifactFromStorage(@NotNull Artifact artifact, @NotNull ArtifactHandlerConfigProvider artifactHandlerConfigProvider)Removes artifact files for a single artifact.voidremoveArtifactFromStorage(@NotNull PlanResultKey planResultKey, @NotNull ImmutableArtifactDefinitionBase artifact, @NotNull ArtifactHandlerConfigProvider artifactHandlerConfigProvider)Removes artifact files for a single artifact.voidremoveArtifactFromStorage(@NotNull ResultKey planResultKey, @NotNull ImmutableArtifactDefinitionBase artifact, @NotNull ArtifactHandlerConfigProvider artifactHandlerConfigProvider)Removes artifact files for a single artifact.voidremoveArtifactsFromStorage(@NotNull PlanKey planKey, @NotNull ArtifactHandlerConfigProvider artifactHandlerConfigProvider)Removes artifact files for all results of a single chain or job.voidremoveArtifactsFromStorage(@NotNull PlanResultKey planResultKey, @NotNull ArtifactHandlerConfigProvider artifactHandlerConfigProvider)Removes artifact files for a single plan result.@NotNull ArtifactRetrievalStatusretrieve(@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
-
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
-
Methods inherited from interface com.atlassian.bamboo.build.artifact.ArtifactHandler
publish
-
-
-
-
Method Detail
-
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:ArtifactHandlerRetrieve 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
public int getSpeed(@NotNull @NotNull Map<String,String> artifactHandlersConfiguration)Description copied from interface:ArtifactHandlerReturn 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:ArtifactHandlerRemoves 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:ArtifactHandlerRemoves artifact files for a single artifact. Called when removingArtifactLinkShould 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:ArtifactHandlerRemoves artifact files for a single artifact. Called when removingArtifactLinkShould 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:ArtifactHandlerRemoves artifact files for a single plan result. Called when removingResultsSummaryShould 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:ArtifactHandlerRemoves artifact files for all results of a single chain or job. Called when removingPlanCalling 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:ArtifactHandlerRemoves artifact files for all results of a single chain. Called when removingChainShould 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:ArtifactHandlerMove 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)
-
-