Interface ArtifactDefinitionManager

    • Method Detail

      • findArtifactDefinition

        @Nullable
        @Nullable ArtifactDefinition findArtifactDefinition​(long id)
        Get artifact definition of specified id
        Parameters:
        id - id of artifact definition
        Returns:
        artifact definition of specified id or null if not found
      • findArtifactDefinition

        @Nullable
        @Nullable ArtifactDefinition findArtifactDefinition​(@NotNull
                                                            @NotNull ImmutablePlan plan,
                                                            @NotNull
                                                            @NotNull String label)
        Get artifact definition associated with a plan of a given label
        Parameters:
        plan - plan which associated artifact definition should be retrieved
        label - label to search among plan's artifact definitions
        Returns:
        artifact definition matching plan and label or null if not found
      • findArtifactDefinitionsByPlan

        @NotNull
        @NotNull List<ArtifactDefinition> findArtifactDefinitionsByPlan​(@NotNull
                                                                        @NotNull ImmutablePlan plan)
        Get list of artifact definitions associated with a specific plan. (Does not recurse into children. i.e. if passed a chain, wont look at jobs)
        Parameters:
        plan - plan which associated artifact definitions should be retrieved
        Returns:
        list of artifact definitions
      • findSharedArtifactsByChain

        @NotNull
        @NotNull List<ArtifactDefinition> findSharedArtifactsByChain​(@NotNull
                                                                     @NotNull ImmutableChain chain)
        Find all shared artifacts that exist for a particular chain (looks through all jobs).
        Parameters:
        chain - chain which associated artifact definitions should be retrieved
        Returns:
        shared artifacts that exist for the specified particular chain
      • removeArtifactDefinition

        void removeArtifactDefinition​(@NotNull
                                      @NotNull ArtifactDefinition artifactDefinition)
        Remove artifact definition.
        Parameters:
        artifactDefinition - ArtifactDefinition to be removed
      • removeArtifactDefinitionsByPlan

        @Deprecated
        void removeArtifactDefinitionsByPlan​(@NotNull
                                             @NotNull Plan plan)
        Deprecated.
        Remove all artifact definitions associated with a plan.
        Parameters:
        plan - plan which associated artifact definitions should be removed
      • removeArtifactDefinitionsByPlan

        void removeArtifactDefinitionsByPlan​(@NotNull
                                             @NotNull ImmutablePlan plan)
        Remove all artifact definitions associated with a plan.
        Parameters:
        plan - plan which associated artifact definitions should be removed
      • saveArtifactDefinition

        void saveArtifactDefinition​(@NotNull
                                    @NotNull ArtifactDefinition artifactDefinition)
        Save/update artifact definition. This method will generate appropriate event for saved/updated artifactDefinition.
        Parameters:
        artifactDefinition - object to be saved/updated
      • saveArtifactDefinitions

        void saveArtifactDefinitions​(@NotNull
                                     @NotNull Collection<ArtifactDefinition> artifactDefinitions)
        Save all artifact definitions in a collection. This method will generate event for each newly created artifact in the list.
        Parameters:
        artifactDefinitions - collection of objects to be saved/updated
      • cloneArtifactDefinitions

        @NotNull
        @NotNull Map<ArtifactDefinition,​ArtifactDefinition> cloneArtifactDefinitions​(@NotNull
                                                                                           @NotNull Job sourcePlan,
                                                                                           @NotNull
                                                                                           @NotNull Job targetPlan,
                                                                                           boolean preserveSharedFlag)
        Creates artifact definitions objects for a Buildable plan based according to definitions associated with input Buildable plan. This method does not persist the objects.
        Parameters:
        sourcePlan - plan which associated artifact definitions should be cloned
        targetPlan - plan for which artifacts should be created
        preserveSharedFlag - false will degrade all the artifacts to job level artifacts
        Returns:
        map of original and cloned artifact definitions
      • cloneArtifactDefinitions

        @NotNull
        @NotNull Map<ArtifactDefinition,​ArtifactDefinition> cloneArtifactDefinitions​(@NotNull
                                                                                           @NotNull Job sourcePlan,
                                                                                           @NotNull
                                                                                           @NotNull Job targetPlan)
        Creates artifact definitions objects for a Buildable plan based according to definitions associated with input Buildable plan. This method does not persist the objects. SharedArtifact flags are copied.
        Parameters:
        sourcePlan - plan which associated artifact definitions should be cloned
        targetPlan - plan for which artifacts should be created
        Returns:
        map of original and cloned artifact definitions
      • isArtifactDefinitionNameUniqueInJob

        boolean isArtifactDefinitionNameUniqueInJob​(@NotNull
                                                    @NotNull ArtifactDefinition artifactDefinition)
        Test if artifact definition's name is unique within a producer job.
        Parameters:
        artifactDefinition - artifact definition to be validated
        Returns:
        true if name is unique