public abstract class AbstractArtifactManager extends Object implements ArtifactManager
| Modifier and Type | Field and Description |
|---|---|
static String |
ARTIFACT_SECURITY_TOKEN |
| Constructor and Description |
|---|
AbstractArtifactManager() |
| Modifier and Type | Method and Description |
|---|---|
protected Artifact |
findMatchingArtifact(String artifactHandlerKey,
Collection<Artifact> matchingArtifacts) |
protected Iterable<ArtifactHandler> |
getArtifactHandlers(ArtifactDefinitionContext artifact,
Map<String,String> artifactHandlersConfiguration) |
List<ArtifactHandler> |
getArtifactHandlersForAgent(AgentType agentType)
Get list of enabled artifact handlers usable on agent of a given type.
|
protected abstract void |
markSubscriptionAsConsumed(PlanResultKey planResultKey,
ArtifactSubscriptionContext artifactSubscription,
String linkType) |
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.
|
protected ArtifactPublishingResult |
publishFileSet(PlanResultKey planResultKey,
ArtifactDefinitionContext artifact,
org.apache.tools.ant.types.FileSet sourceFileSet,
Map<String,String> artifactHandlersConfiguration,
BuildLogger buildLogger) |
void |
removeArtifactFromStorage(Artifact artifact)
Removes artifact files for a single 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.
|
boolean |
removeOrphanedArtifacts() |
boolean |
retrieve(BuildLogger buildLogger,
PlanResultKey planResultKey,
ArtifactSubscriptionContext artifactSubscription,
Map<String,String> artifactHandlersConfiguration,
File buildWorkingDirectory,
com.google.common.collect.Multimap<String,Artifact> availableArtifacts)
Retrieves a plan artifact from artifact storage.
|
boolean |
retrieve(BuildLogger buildLogger,
PlanResultKey planResultKey,
ResultKey resultKey,
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
|
public static final String ARTIFACT_SECURITY_TOKEN
public ArtifactPublishingResult publish(@Nullable BuildLogger buildLogger, @NotNull PlanResultKey planResultKey, @NotNull File baseDirectory, @NotNull ArtifactDefinitionContext artifact, @NotNull Map<String,String> artifactHandlerConfiguration, int minExpectedFilesCnt)
ArtifactManagerpublish in interface ArtifactManagerbuildLogger - 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 madepublic final ErrorCollection validateArtifactsSize(@NotNull File baseDirectory, @NotNull ArtifactContext artifactContext)
ArtifactManagervalidateArtifactsSize in interface ArtifactManagerartifactContext - contains artifacts size quota if setprotected ArtifactPublishingResult publishFileSet(PlanResultKey planResultKey, ArtifactDefinitionContext artifact, org.apache.tools.ant.types.FileSet sourceFileSet, Map<String,String> artifactHandlersConfiguration, BuildLogger buildLogger)
public boolean retrieve(@Nullable
BuildLogger buildLogger,
@NotNull
PlanResultKey planResultKey,
@NotNull
ArtifactSubscriptionContext artifactSubscription,
@NotNull
Map<String,String> artifactHandlersConfiguration,
@NotNull
File buildWorkingDirectory,
@NotNull
com.google.common.collect.Multimap<String,Artifact> availableArtifacts)
ArtifactManagerretrieve in interface ArtifactManagerbuildLogger - 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 resultpublic boolean retrieve(@Nullable
BuildLogger buildLogger,
@NotNull
PlanResultKey planResultKey,
@NotNull
ResultKey resultKey,
@NotNull
ArtifactDefinitionContext artifactDefinitionContext,
@NotNull
String destinationPath,
@NotNull
Map<String,String> artifactHandlersConfiguration,
@NotNull
File buildWorkingDirectory,
@NotNull
com.google.common.collect.Multimap<String,Artifact> availableArtifacts)
ArtifactManagerArtifact object will be used to find artifact in the storage.retrieve in interface ArtifactManager@Nullable protected Artifact findMatchingArtifact(String artifactHandlerKey, Collection<Artifact> matchingArtifacts)
protected abstract void markSubscriptionAsConsumed(PlanResultKey planResultKey, ArtifactSubscriptionContext artifactSubscription, String linkType)
protected Iterable<ArtifactHandler> getArtifactHandlers(ArtifactDefinitionContext artifact, Map<String,String> artifactHandlersConfiguration)
public void removeArtifactsFromStorage(Iterable<ArtifactLink> artifactLinks)
ArtifactManagerResultsSummary
Should not remove artifacts that were moved to global storage.removeArtifactsFromStorage in interface ArtifactManagerpublic void removeArtifactsFromStorage(@NotNull
PlanKey planKey)
ArtifactManagerPlan
Should not remove artifacts that were moved to global storage.removeArtifactsFromStorage in interface ArtifactManagerpublic void removeArtifactFromStorage(@NotNull
Artifact artifact)
ArtifactManagerremoveArtifactFromStorage in interface ArtifactManagerpublic void moveArtifactToGlobalStorage(@NotNull
Artifact artifact)
throws IOException
ArtifactManagerArtifactManager.removeArtifactFromStorage(Artifact) is called.
It is not a requirement to physically move the files as long as the above contract is fulfilled.moveArtifactToGlobalStorage in interface ArtifactManagerIOExceptionpublic boolean removeOrphanedArtifacts()
removeOrphanedArtifacts in interface ArtifactManager@NotNull public List<ArtifactHandler> getArtifactHandlersForAgent(@NotNull AgentType agentType)
ArtifactManagergetArtifactHandlersForAgent in interface ArtifactManagerCopyright © 2017 Atlassian Software Systems Pty Ltd. All rights reserved.