Class AbstractArtifactHandler
- java.lang.Object
-
- com.atlassian.bamboo.build.artifact.AbstractArtifactHandler
-
- All Implemented Interfaces:
ArtifactHandler
,InitablePluginModule<ArtifactHandlerModuleDescriptor>
,BambooPluginModule
- Direct Known Subclasses:
AbstractLocalArtifactHandler
,AbstractRepublishingArtifactHandler
public abstract class AbstractArtifactHandler extends Object implements ArtifactHandler, InitablePluginModule<ArtifactHandlerModuleDescriptor>
-
-
Field Summary
Fields Modifier and Type Field Description protected static Set<AgentType>
ALL_AGENT_TYPES
protected static Set<AgentType>
LOCAL_AGENTS
static Set<AgentType>
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 AbstractArtifactHandler(Set<AgentType> supportedAgents)
-
Method Summary
All Methods Static Methods Instance Methods Concrete Methods Modifier and Type Method Description boolean
canHandleArtifact(ArtifactDefinitionContext artifact, Map<String,String> artifactHandlersConfiguration)
static @NotNull ArtifactHandlerConfigProvider
configProvider(@NotNull ArtifactHandlersService artifactHandlersService)
Create ArtifactHandlerConfigProvider that will return runtime configuration fetched from ArtifactHandlerService.static @NotNull ArtifactHandlerConfigProvider
configProvider(@NotNull Map<String,String> artifactHandlerConfiguration)
Create ArtifactHandlerConfigProvider that will return passed configurationprotected String
getConfigurationKey(String key)
protected @Nullable String
getConfigValue(Map<String,String> artifactHandlersConfiguration, String key)
@NotNull Map<String,String>
getDefaultConfiguration()
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.@NotNull ArtifactHandlerModuleDescriptor
getModuleDescriptor()
@NotNull Set<AgentType>
getSupportedAgents()
void
init(@NotNull ArtifactHandlerModuleDescriptor moduleDescriptor)
Initialises the Plugin with the plugin module descriptor-
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
getArtifactLinkDataProvider, getArtifactLinkDataProvider, getSpeed, moveArtifactToGlobalStorage, publish, publish, removeAllArtifactsOfChain, removeArtifactFromStorage, removeArtifactFromStorage, removeArtifactFromStorage, removeArtifactsFromStorage, removeArtifactsFromStorage, retrieve
-
-
-
-
Method Detail
-
init
public void init(@NotNull @NotNull ArtifactHandlerModuleDescriptor moduleDescriptor)
Description copied from interface:InitablePluginModule
Initialises the Plugin with the plugin module descriptor- Specified by:
init
in interfaceInitablePluginModule<ArtifactHandlerModuleDescriptor>
- Parameters:
moduleDescriptor
- Plugin module descriptor
-
canHandleArtifact
public boolean canHandleArtifact(ArtifactDefinitionContext artifact, Map<String,String> artifactHandlersConfiguration)
- Specified by:
canHandleArtifact
in interfaceArtifactHandler
-
getDefaultConfiguration
@NotNull public @NotNull Map<String,String> getDefaultConfiguration()
- Specified by:
getDefaultConfiguration
in interfaceArtifactHandler
-
getConfigValue
@Nullable protected @Nullable String getConfigValue(Map<String,String> artifactHandlersConfiguration, String key)
-
getSupportedAgents
@NotNull public @NotNull Set<AgentType> getSupportedAgents()
- Specified by:
getSupportedAgents
in interfaceArtifactHandler
-
getModuleDescriptor
@NotNull public @NotNull ArtifactHandlerModuleDescriptor getModuleDescriptor()
- Specified by:
getModuleDescriptor
in interfaceArtifactHandler
-
configProvider
@NotNull public static @NotNull ArtifactHandlerConfigProvider configProvider(@NotNull @NotNull Map<String,String> artifactHandlerConfiguration)
Create ArtifactHandlerConfigProvider that will return passed configuration
-
configProvider
@NotNull public static @NotNull ArtifactHandlerConfigProvider configProvider(@NotNull @NotNull ArtifactHandlersService artifactHandlersService)
Create ArtifactHandlerConfigProvider that will return runtime configuration fetched from ArtifactHandlerService. This should be used to avoid unnecessary early fetching of configuration when it is not needed.
-
getMaxUnarchivedFilesPerArtifact
public long getMaxUnarchivedFilesPerArtifact(@NotNull @NotNull Map<String,String> artifactHandlersConfiguration)
Description copied from interface: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.- Specified by:
getMaxUnarchivedFilesPerArtifact
in interfaceArtifactHandler
- Parameters:
artifactHandlersConfiguration
- artifact handler configuration- Returns:
- maximum number of files per artifact that should not be packaged into a single file
-
-