@PublicApi
public interface ArtifactManager
Modifier and Type | Method and Description |
---|---|
List<ArtifactHandler> |
getArtifactHandlersForAgent(AgentType agentType)
Get list of enabled artifact handlers usable on agent of a given type.
|
void |
moveArtifactToGlobalStorage(Artifact artifact)
Move artifact to a 'global storage'.
|
ArtifactPublishingResult |
publish(BuildLogger buildLogger,
PlanResultKey planResultKey,
File baseDirectory,
ArtifactDefinitionContext artifact,
Map<String,String> artifactHandlerConfiguration,
int minExpectedFilesCnt)
Request copy of artifacts from a designated location to artifact storage.
|
boolean |
publish(BuildLogger buildLogger,
PlanResultKey planResultKey,
File baseDirectory,
ArtifactDefinitionContext artifact,
Map<String,String> artifactHandlerConfiguration,
Set<String> successfulPublishers,
int minExpectedFilesCnt)
|
void |
removeArtifactFromStorage(Artifact artifact)
Removes artifact files for a single artifact.
|
void |
removeArtifactFromStorage(PlanResultKey planResultKey,
ImmutableArtifactDefinitionBase artifact)
Deprecated.
since 5.5 use
removeArtifactFromStorage(Artifact) |
void |
removeArtifactsFromStorage(Iterable<ArtifactLink> artifactLinks)
Removes artifact files for all plan results attached to supplied links.
|
void |
removeArtifactsFromStorage(PlanKey planKey)
Removes artifact files for all results of a single.
|
void |
removeArtifactsFromStorage(PlanResultKey planResultKey)
Deprecated.
since 5.7
|
boolean |
removeOrphanedArtifacts() |
boolean |
retrieve(BuildLogger buildLogger,
PlanResultKey planResultKey,
ArtifactSubscriptionContext artifactSubscription,
Map<String,String> artifactHandlerConfiguration,
File buildWorkingDirectory,
com.google.common.collect.Multimap<String,Artifact> availableArtifacts)
Retrieves a plan artifact from artifact storage.
|
boolean |
retrieve(BuildLogger buildLogger,
PlanResultKey planResultKey,
ResultKey clientKey,
ArtifactDefinitionContext artifactDefinitionContext,
String destinationPath,
Map<String,String> artifactHandlersConfiguration,
File buildWorkingDirectory,
com.google.common.collect.Multimap<String,Artifact> availableArtifacts)
Retrieves an artifact from artifact storage.
|
ErrorCollection |
validateArtifactsSize(File baseDirectory,
ArtifactContext artifactContext)
Validates total size of artifacts produced for single build result
|
ArtifactPublishingResult publish(@Nullable BuildLogger buildLogger, @NotNull PlanResultKey planResultKey, @NotNull File baseDirectory, @NotNull ArtifactDefinitionContext artifact, @NotNull Map<String,String> artifactHandlerConfiguration, int minExpectedFilesCnt)
buildLogger
- optional, used to log messagesplanResultKey
- key of a plan result that created the artifactartifact
- definition of the artifactminExpectedFilesCnt
- how many files are necessary to consider the artifact complete, null if no
requirements are made@Deprecated boolean publish(@Nullable BuildLogger buildLogger, @NotNull PlanResultKey planResultKey, @NotNull File baseDirectory, @NotNull ArtifactDefinitionContext artifact, @NotNull Map<String,String> artifactHandlerConfiguration, @NotNull Set<String> successfulPublishers, int minExpectedFilesCnt)
publish(com.atlassian.bamboo.build.logger.BuildLogger, com.atlassian.bamboo.plan.PlanResultKey, java.io.File, com.atlassian.bamboo.plan.artifact.ArtifactDefinitionContext, java.util.Map, int)
}buildLogger
- optional, used to log messagesplanResultKey
- key of a plan result that created the artifactartifact
- definition of the artifactsuccessfulPublishers
- used to return a list of plugin keys for ArtifactHandlers that succesfully published
artifactsminExpectedFilesCnt
- how many files are necessary to consider the artifact complete, null if no
requirements are madeboolean retrieve(@Nullable BuildLogger buildLogger, @NotNull PlanResultKey planResultKey, @NotNull ArtifactSubscriptionContext artifactSubscription, @NotNull Map<String,String> artifactHandlerConfiguration, @NotNull File buildWorkingDirectory, @NotNull com.google.common.collect.Multimap<String,Artifact> availableArtifacts)
buildLogger
- to useplanResultKey
- the plan result that contains the artifactartifactSubscription
- the artifact subscription used to identify artifactbuildWorkingDirectory
- working directory of current buildavailableArtifacts
- artifacts found in source resultboolean retrieve(@Nullable BuildLogger buildLogger, @NotNull PlanResultKey planResultKey, @NotNull ResultKey clientKey, @NotNull ArtifactDefinitionContext artifactDefinitionContext, @NotNull String destinationPath, @NotNull Map<String,String> artifactHandlersConfiguration, @NotNull File buildWorkingDirectory, @NotNull com.google.common.collect.Multimap<String,Artifact> availableArtifacts)
Artifact
object will be used to find artifact in the storage.buildLogger
- planResultKey
- clientKey
- artifactDefinitionContext
- destinationPath
- artifactHandlersConfiguration
- buildWorkingDirectory
- availableArtifacts
- ErrorCollection validateArtifactsSize(@NotNull File baseDirectory, @NotNull ArtifactContext artifactContext)
baseDirectory
- artifactContext
- contains artifacts size quota if setvoid removeArtifactFromStorage(@NotNull Artifact artifact)
@Deprecated void removeArtifactFromStorage(@NotNull PlanResultKey planResultKey, @NotNull ImmutableArtifactDefinitionBase artifact)
removeArtifactFromStorage(Artifact)
@Deprecated void removeArtifactsFromStorage(@NotNull PlanResultKey planResultKey)
ResultsSummary
Should not remove artifacts that were moved to global storage.void removeArtifactsFromStorage(@NotNull Iterable<ArtifactLink> artifactLinks)
ResultsSummary
Should not remove artifacts that were moved to global storage.void removeArtifactsFromStorage(@NotNull PlanKey planKey)
Plan
Should not remove artifacts that were moved to global storage.void moveArtifactToGlobalStorage(@NotNull Artifact artifact) throws IOException
removeArtifactFromStorage(Artifact)
is called.
It is not a requirement to physically move the files as long as the above contract is fulfilled.artifact
- IOException
boolean removeOrphanedArtifacts()
@NotNull List<ArtifactHandler> getArtifactHandlersForAgent(@NotNull AgentType agentType)
Copyright © 2017 Atlassian Software Systems Pty Ltd. All rights reserved.