com.atlassian.bamboo.build.artifact
Interface ArtifactManager

All Known Implementing Classes:
AbstractArtifactManager, LocalArtifactManager, RemoteArtifactManager

public interface ArtifactManager

A common interface for artifact managers


Method Summary
 void moveArtifactToGlobalStorage(Artifact artifact)
          Move artifact to a 'global storage'.
 boolean publish(BuildLogger buildLogger, PlanResultKey planResultKey, java.io.File baseDirectory, ArtifactDefinitionContext artifact, java.util.Map<java.lang.String,java.lang.String> artifactHandlerConfiguration, int minExpectedFilesCnt)
          Deprecated. since 4.4 use $publish(BuildLogger, PlanResultKey, File, ArtifactDefinitionContext, Map, Set, int)
 boolean publish(BuildLogger buildLogger, PlanResultKey planResultKey, java.io.File baseDirectory, ArtifactDefinitionContext artifact, java.util.Map<java.lang.String,java.lang.String> artifactHandlerConfiguration, java.util.Set<java.lang.String> successfulPublishers, int minExpectedFilesCnt)
          Request copy of artifacts from a designated location to artifact storage.
 void removeArtifactFromStorage(Artifact artifact)
          Removes artifact files for a single artifact.
 void removeArtifactFromStorage(PlanResultKey planResultKey, ImmutableArtifactDefinitionBase artifact)
          Deprecated. use removeArtifactFromStorage(Artifact)
 void removeArtifactsFromStorage(PlanKey planKey)
          Removes artifact files for all results of a single.
 void removeArtifactsFromStorage(PlanResultKey planResultKey)
          Removes artifact files for a single plan result.
 void removeOrphanedArtifacts()
           
 boolean retrieve(BuildLogger buildLogger, PlanResultKey planResultKey, ArtifactSubscriptionContext artifactSubscription, java.util.Map<java.lang.String,java.lang.String> artifactHandlerConfiguration, java.io.File buildWorkingDirectory)
          Retrieves a plan artifact from artifact storage.
 boolean retrieve(BuildLogger buildLogger, PlanResultKey planResultKey, ResultKey clientKey, ArtifactDefinitionContext artifactDefinitionContext, java.lang.String destinationPath, java.util.Map<java.lang.String,java.lang.String> artifactHandlersConfiguration, java.io.File buildWorkingDirectory, java.util.Map<java.lang.String,Artifact> versionArtifacts)
          Retrieves an artifact from artifact storage.
 ErrorCollection validateArtifactsSize(java.io.File baseDirectory, ArtifactContext artifactContext)
          Validates total size of artifacts produced for single build result
 

Method Detail

publish

boolean publish(@Nullable
                BuildLogger buildLogger,
                @NotNull
                PlanResultKey planResultKey,
                @NotNull
                java.io.File baseDirectory,
                @NotNull
                ArtifactDefinitionContext artifact,
                @NotNull
                java.util.Map<java.lang.String,java.lang.String> artifactHandlerConfiguration,
                @NotNull
                java.util.Set<java.lang.String> successfulPublishers,
                int minExpectedFilesCnt)
Request copy of artifacts from a designated location to artifact storage.

Parameters:
buildLogger - optional, used to log messages
planResultKey - key of a plan result that created the artifact
artifact - definition of the artifact
minExpectedFilesCnt - how many files are necessary to consider the artifact complete, null if no requirements are made
successfulPublishers - used to return a list of plugin keys for ArtifactHandlers that succesfully published artifacts
Returns:
true if publish operation result allows the build to continue

publish

@Deprecated
boolean publish(@Nullable
                           BuildLogger buildLogger,
                           @NotNull
                           PlanResultKey planResultKey,
                           @NotNull
                           java.io.File baseDirectory,
                           @NotNull
                           ArtifactDefinitionContext artifact,
                           @NotNull
                           java.util.Map<java.lang.String,java.lang.String> artifactHandlerConfiguration,
                           int minExpectedFilesCnt)
Deprecated. since 4.4 use $publish(BuildLogger, PlanResultKey, File, ArtifactDefinitionContext, Map, Set, int)

Request copy of artifacts from a designated location to artifact storage.

Parameters:
buildLogger - optional, used to log messages
planResultKey - key of a plan result that created the artifact
artifact - definition of the artifact
minExpectedFilesCnt - how many files are necessary to consider the artifact complete, null if no requirements are made
Returns:
true if publish operation result allows the build to continue

retrieve

boolean retrieve(@Nullable
                 BuildLogger buildLogger,
                 @NotNull
                 PlanResultKey planResultKey,
                 @NotNull
                 ArtifactSubscriptionContext artifactSubscription,
                 @NotNull
                 java.util.Map<java.lang.String,java.lang.String> artifactHandlerConfiguration,
                 @NotNull
                 java.io.File buildWorkingDirectory)
Retrieves a plan artifact from artifact storage.

Parameters:
buildLogger - to use
planResultKey - the plan result that contains the artifact
artifactSubscription - the artifact subscription used to identify artifact
buildWorkingDirectory - working directory of current build
Returns:
true if retrieval was successful, false otherwise

retrieve

boolean retrieve(@Nullable
                 BuildLogger buildLogger,
                 @NotNull
                 PlanResultKey planResultKey,
                 @NotNull
                 ResultKey clientKey,
                 @NotNull
                 ArtifactDefinitionContext artifactDefinitionContext,
                 @NotNull
                 java.lang.String destinationPath,
                 @NotNull
                 java.util.Map<java.lang.String,java.lang.String> artifactHandlersConfiguration,
                 @NotNull
                 java.io.File buildWorkingDirectory,
                 @Nullable
                 java.util.Map<java.lang.String,Artifact> versionArtifacts)
Retrieves an artifact from artifact storage. The important difference for that method is, that NO subscription information is updated. Useful for retrieving artifacts in non standard way (cross-plan for example) If versionArtifacts parameter is specified, the method will first try to match requested artifact with the content of the map. If match is found, information in Artifact object will be used to find artifact in the storage.

Parameters:
buildLogger -
planResultKey -
clientKey -
artifactDefinitionContext -
destinationPath -
artifactHandlersConfiguration -
buildWorkingDirectory -
versionArtifacts -
Returns:

validateArtifactsSize

ErrorCollection validateArtifactsSize(@NotNull
                                      java.io.File baseDirectory,
                                      @NotNull
                                      ArtifactContext artifactContext)
Validates total size of artifacts produced for single build result

Parameters:
baseDirectory -
artifactContext - contains artifacts size quota if set
Returns:
error set in in case of exceeding quota if set

removeArtifactFromStorage

void removeArtifactFromStorage(@NotNull
                               Artifact artifact)
Removes artifact files for a single artifact.


removeArtifactFromStorage

@Deprecated
void removeArtifactFromStorage(@NotNull
                                          PlanResultKey planResultKey,
                                          @NotNull
                                          ImmutableArtifactDefinitionBase artifact)
Deprecated. use removeArtifactFromStorage(Artifact)

Removes artifact files for a single artifact.


removeArtifactsFromStorage

void removeArtifactsFromStorage(@NotNull
                                PlanResultKey planResultKey)
Removes artifact files for a single plan result. Called when removing ResultsSummary Should not remove artifacts that were moved to global storage.


removeArtifactsFromStorage

void removeArtifactsFromStorage(@NotNull
                                PlanKey planKey)
Removes artifact files for all results of a single. Called when removing Plan Should not remove artifacts that were moved to global storage.


moveArtifactToGlobalStorage

void moveArtifactToGlobalStorage(@NotNull
                                 Artifact artifact)
Move artifact to a 'global storage'. Artifacts in 'global storage' should only be removed when removeArtifactFromStorage(Artifact) is called. It is not a requirement to physically move the files as long as the above contract is fulfilled.

Parameters:
artifact -
Since:
5.0

removeOrphanedArtifacts

void removeOrphanedArtifacts()


Copyright © 2013 Atlassian Software Systems Pty Ltd. All Rights Reserved.