Class AbstractArtifactManager

    • Constructor Detail

      • AbstractArtifactManager

        public AbstractArtifactManager()
    • Method Detail

      • publish

        public ArtifactPublishingResult publish​(@Nullable
                                                @Nullable BuildLogger buildLogger,
                                                @NotNull
                                                @NotNull PlanResultKey resultKey,
                                                @NotNull
                                                @NotNull File baseDirectory,
                                                @NotNull
                                                @NotNull ArtifactDefinitionContext artifact,
                                                @NotNull
                                                @NotNull Map<String,​String> artifactHandlerConfiguration,
                                                int minExpectedFilesCnt)
        Description copied from interface: ArtifactManager
        Request copy of artifacts from a designated location to artifact storage.
        Specified by:
        publish in interface ArtifactManager
        Parameters:
        buildLogger - optional, used to log messages
        resultKey - 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
      • publish

        public ArtifactPublishingResult publish​(@Nullable
                                                @Nullable BuildLogger buildLogger,
                                                @NotNull
                                                @NotNull ResultKey resultKey,
                                                @NotNull
                                                @NotNull File baseDirectory,
                                                @NotNull
                                                @NotNull ArtifactDefinitionContext artifact,
                                                @NotNull
                                                @NotNull Map<String,​String> artifactHandlerConfiguration,
                                                int minExpectedFilesCnt)
        Description copied from interface: ArtifactManager
        Request copy of artifacts from a designated location to artifact storage.
        Specified by:
        publish in interface ArtifactManager
        Parameters:
        buildLogger - optional, used to log messages
        resultKey - key of a plan or deployment 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
      • validateArtifactsSize

        public final ErrorCollection validateArtifactsSize​(@NotNull
                                                           @NotNull File baseDirectory,
                                                           @NotNull
                                                           @NotNull ArtifactContext artifactContext)
        Description copied from interface: ArtifactManager
        Validates total size of artifacts produced for single build result
        Specified by:
        validateArtifactsSize in interface ArtifactManager
        artifactContext - contains artifacts size quota if set
        Returns:
        error set in in case of exceeding quota if set
      • retrieve

        public boolean retrieve​(@Nullable
                                @Nullable BuildLogger buildLogger,
                                @NotNull
                                @NotNull PlanResultKey planResultKey,
                                @NotNull
                                @NotNull ArtifactSubscriptionContext artifactSubscription,
                                @NotNull
                                @NotNull Map<String,​String> artifactHandlersConfiguration,
                                @NotNull
                                @NotNull File buildWorkingDirectory,
                                @NotNull
                                @NotNull com.google.common.collect.Multimap<String,​Artifact> availableArtifacts)
        Description copied from interface: ArtifactManager
        Retrieves a plan artifact from artifact storage.
        Specified by:
        retrieve in interface ArtifactManager
        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
        availableArtifacts - artifacts found in source result
        Returns:
        true if retrieval was successful, false otherwise
      • retrieve

        public boolean retrieve​(@Nullable
                                @Nullable BuildLogger buildLogger,
                                @NotNull
                                @NotNull PlanResultKey planResultKey,
                                @NotNull
                                @NotNull ResultKey resultKey,
                                @NotNull
                                @NotNull ArtifactDefinitionContext artifactDefinitionContext,
                                @NotNull
                                @NotNull String destinationPath,
                                @NotNull
                                @NotNull Map<String,​String> artifactHandlersConfiguration,
                                @NotNull
                                @NotNull File buildWorkingDirectory,
                                @NotNull
                                @NotNull com.google.common.collect.Multimap<String,​Artifact> availableArtifacts)
        Description copied from interface: ArtifactManager
        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.
        Specified by:
        retrieve in interface ArtifactManager
        Returns:
      • removeArtifactsFromStorage

        public void removeArtifactsFromStorage​(@NotNull
                                               @NotNull PlanKey planKey,
                                               @NotNull
                                               @NotNull Map<String,​String> artifactHandlersConfiguration)
        Description copied from interface: ArtifactManager
        Removes artifact files for all results of a single. Called when removing Plan Should not remove artifacts that were moved to global storage.
        Specified by:
        removeArtifactsFromStorage in interface ArtifactManager
      • removeAllArtifactsOfChain

        public void removeAllArtifactsOfChain​(@NotNull
                                              @NotNull PlanKey planKey,
                                              @NotNull
                                              @NotNull Iterable<PlanKey> jobKeys,
                                              @NotNull
                                              @NotNull Map<String,​String> artifactHandlersConfiguration)
        Description copied from interface: ArtifactManager
        Removes artifact files for all results of a single chain. Called when removing Chain Should not remove artifacts that were moved to global storage.
        Specified by:
        removeAllArtifactsOfChain in interface ArtifactManager
      • removeArtifactsFromStorage

        public void removeArtifactsFromStorage​(@NotNull
                                               @NotNull PlanKey planKey)
        Description copied from interface: ArtifactManager
        Removes artifact files for all results of a single. Called when removing Plan Should not remove artifacts that were moved to global storage.
        Specified by:
        removeArtifactsFromStorage in interface ArtifactManager
      • removeArtifactsIfOrphaned

        public boolean removeArtifactsIfOrphaned​(@NotNull
                                                 @NotNull List<Long> artifactIds)
        Description copied from interface: ArtifactManager
        Removes artifacts identified by the ids on the list, but only if they are not referenced by any deployment version or build result.
        Specified by:
        removeArtifactsIfOrphaned in interface ArtifactManager
        Returns:
        true if anything was removed
      • getArtifactHandlersForAgent

        @NotNull
        public @NotNull List<ArtifactHandler> getArtifactHandlersForAgent​(@NotNull
                                                                          @NotNull AgentType agentType)
        Description copied from interface: ArtifactManager
        Get list of enabled artifact handlers usable on agent of a given type. This method should be called by agents and it doesn't filter artifact handlers according to - Bamboo instance type
        Specified by:
        getArtifactHandlersForAgent in interface ArtifactManager