Interface ArtifactDefinitionDao
-
- All Superinterfaces:
BambooObjectDao<ArtifactDefinition>
- All Known Implementing Classes:
ArtifactDefinitionHibernateDao
public interface ArtifactDefinitionDao extends BambooObjectDao<ArtifactDefinition>
-
-
Method Summary
All Methods Instance Methods Abstract Methods Modifier and Type Method Description @NotNull Collection<? extends ArtifactDefinition>
findAll()
Find all artifact definitions@NotNull Collection<? extends ArtifactDefinition>
findAll(int firstResult, int maxResults)
@Nullable ArtifactDefinition
findById(long id)
Get artifact definition of specified id@Nullable ArtifactDefinition
findByName(@NotNull ImmutablePlan plan, @NotNull String name)
Find artifact definition of a given name associated with a producer job.@Nullable ArtifactDefinition
findByNameInChain(@NotNull ImmutableChain chain, @NotNull String name)
Find artifact definition of a given name which has sharedArtifact property set to true, associated with a producer job that belongs to the chain.@NotNull List<ArtifactDefinition>
findByProducer(@NotNull ImmutablePlan plan)
Get list of artifact definitions associated with a plan@NotNull List<ArtifactDefinition>
findSharedArtifactsByChain(@NotNull ImmutableChain chain)
Find all shared artifacts that exist for a particular chain.@NotNull BambooEntityOid
getMaxArtifactDefinitionOid(int serverKey)
Find maximum oid used by existing objects in the db.void
removeByProducer(@NotNull ImmutablePlan plan)
Remove all artifact definitions associated with a plan.-
Methods inherited from interface com.atlassian.bamboo.persistence3.BambooObjectDao
countAll, countWithRestriction, delete, deleteAll, findAll, findById, merge, save, saveAll
-
-
-
-
Method Detail
-
findById
@Nullable @Nullable ArtifactDefinition findById(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
-
findByName
@Nullable @Nullable ArtifactDefinition findByName(@NotNull @NotNull ImmutablePlan plan, @NotNull @NotNull String name)
Find artifact definition of a given name associated with a producer job.- Parameters:
plan
- plan which associated artifact definition should be retrievedname
- name to search among plan's artifact definitions- Returns:
- artifact definition matching plan and label or null if not found
-
findByNameInChain
@Nullable @Nullable ArtifactDefinition findByNameInChain(@NotNull @NotNull ImmutableChain chain, @NotNull @NotNull String name)
Find artifact definition of a given name which has sharedArtifact property set to true, associated with a producer job that belongs to the chain.- Parameters:
chain
- chain which associated artifact definition should be retrievedname
- name to search among plan's artifact definitions- Returns:
- artifact definition matching plan and label or null if not found
-
findAll
@NotNull @NotNull Collection<? extends ArtifactDefinition> findAll()
Find all artifact definitions- Returns:
- Collection of all artifact definitions
-
findAll
@NotNull @NotNull Collection<? extends ArtifactDefinition> findAll(int firstResult, int maxResults)
-
findByProducer
@NotNull @NotNull List<ArtifactDefinition> findByProducer(@NotNull @NotNull ImmutablePlan plan)
Get list of artifact definitions associated with a plan- 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.- Parameters:
chain
- chain which associated artifact definitions should be retrieved- Returns:
- shared artifacts that exist for the specified particular chain
-
removeByProducer
void removeByProducer(@NotNull @NotNull ImmutablePlan plan)
Remove all artifact definitions associated with a plan.- Parameters:
plan
- plan which associated artifact definitions should be removed
-
getMaxArtifactDefinitionOid
@NotNull @NotNull BambooEntityOid getMaxArtifactDefinitionOid(int serverKey)
Find maximum oid used by existing objects in the db.- Parameters:
serverKey
-- Returns:
-
-