Package com.atlassian.bamboo.labels
Class LabelHibernateDao
- java.lang.Object
-
- org.springframework.dao.support.DaoSupport
-
- org.springframework.orm.hibernate5.support.HibernateDaoSupport
-
- com.atlassian.bamboo.persistence.BambooHibernateObjectDao
-
- com.atlassian.bamboo.labels.LabelHibernateDao
-
- All Implemented Interfaces:
bucket.core.persistence.ObjectDao
,LabelDao
,BambooObjectDao
,org.springframework.beans.factory.InitializingBean
public class LabelHibernateDao extends BambooHibernateObjectDao implements LabelDao
-
-
Constructor Summary
Constructors Constructor Description LabelHibernateDao(@NotNull BambooClusterSettings bambooClusterSettings)
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description @Nullable Label
findLabelByNameAndNamespace(String name, String namespace)
@Nullable Labelling
findLabellingByBuild(Label label, ImmutablePlan plan)
@Nullable Labelling
findLabellingByBuild(String name, String namespace, ImmutablePlan plan)
@Nullable Labelling
findLabellingByProject(Label label, Project project)
@Nullable Labelling
findLabellingByResultsSummary(Label label, ResultsSummary resultsSummary)
@Nullable Labelling
findLabellingByResultsSummary(String name, String namespace, ResultsSummary buildResultsSummary)
@NotNull List<Labelling>
findLabellingByUser(String userName)
@NotNull List<Labelling>
findLabels(ImmutablePlan plan)
@NotNull List<Labelling>
findLabels(Project project)
@NotNull List<LabelCount>
findLabels(String namespace, int maxResults)
@NotNull List<LabelCount>
findLabels(String namespace, int maxResults, Plan plan)
@NotNull List<LabelCount>
findLabels(String namespace, int maxResults, Project project)
@NotNull List<Label>
findLabelsByNameAndNamespace(List<String> names, String namespace)
Find any labels that match the names in the specic namespace@NotNull Set<Label>
findPlanLabels(String namespace)
Finds labels that are *only* plan level labellings matching the namespace.@NotNull Set<Label>
findPlanLabels(String namespace, @NotNull PlanIdentifier plan)
Finds labels that are *only* plan level labellings matching the namespace and associated with a plan.@NotNull List<ResultsSummary>
findResultsSummaryByNameAndNamespace(String name, String namespace)
Class
getPersistentClass()
@NotNull Set<String>
getResultSummaryLabelNames(@NotNull ResultsSummary resultsSummary)
Get names of labels related to result summarylong
getUsageCountForLabel(Label label)
void
remove(@NotNull Labelling labelling)
Removes the labelling from the persistent layervoid
saveLabel(@NotNull Label label)
void
saveLabelling(@NotNull Labelling labelling)
-
Methods inherited from class com.atlassian.bamboo.persistence.BambooHibernateObjectDao
findAll, findAllSorted, findById, findById, refresh, remove, replicate, save, saveRaw, updateModificationData
-
Methods inherited from class org.springframework.orm.hibernate5.support.HibernateDaoSupport
checkDaoConfig, createHibernateTemplate, currentSession, getHibernateTemplate, getSessionFactory, setHibernateTemplate, setSessionFactory
-
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
-
Methods inherited from interface com.atlassian.bamboo.persistence.BambooObjectDao
findById
-
-
-
-
Constructor Detail
-
LabelHibernateDao
@Inject public LabelHibernateDao(@NotNull @NotNull BambooClusterSettings bambooClusterSettings)
-
-
Method Detail
-
getPersistentClass
public Class getPersistentClass()
- Specified by:
getPersistentClass
in interfacebucket.core.persistence.ObjectDao
-
findLabelByNameAndNamespace
@Nullable public @Nullable Label findLabelByNameAndNamespace(String name, String namespace)
- Specified by:
findLabelByNameAndNamespace
in interfaceLabelDao
-
findLabelsByNameAndNamespace
@NotNull public @NotNull List<Label> findLabelsByNameAndNamespace(List<String> names, String namespace)
Description copied from interface:LabelDao
Find any labels that match the names in the specic namespace- Specified by:
findLabelsByNameAndNamespace
in interfaceLabelDao
- Returns:
-
findLabellingByResultsSummary
@Nullable public @Nullable Labelling findLabellingByResultsSummary(Label label, ResultsSummary resultsSummary)
- Specified by:
findLabellingByResultsSummary
in interfaceLabelDao
-
findLabellingByResultsSummary
@Nullable public @Nullable Labelling findLabellingByResultsSummary(String name, String namespace, ResultsSummary buildResultsSummary)
- Specified by:
findLabellingByResultsSummary
in interfaceLabelDao
-
findLabellingByBuild
@Nullable public @Nullable Labelling findLabellingByBuild(Label label, ImmutablePlan plan)
- Specified by:
findLabellingByBuild
in interfaceLabelDao
-
findLabellingByBuild
@Nullable public @Nullable Labelling findLabellingByBuild(String name, String namespace, ImmutablePlan plan)
- Specified by:
findLabellingByBuild
in interfaceLabelDao
-
findLabellingByProject
@Nullable public @Nullable Labelling findLabellingByProject(Label label, Project project)
- Specified by:
findLabellingByProject
in interfaceLabelDao
-
getUsageCountForLabel
public long getUsageCountForLabel(Label label)
- Specified by:
getUsageCountForLabel
in interfaceLabelDao
-
findResultsSummaryByNameAndNamespace
@NotNull public @NotNull List<ResultsSummary> findResultsSummaryByNameAndNamespace(String name, String namespace)
- Specified by:
findResultsSummaryByNameAndNamespace
in interfaceLabelDao
-
findLabels
@NotNull public @NotNull List<LabelCount> findLabels(String namespace, int maxResults)
- Specified by:
findLabels
in interfaceLabelDao
-
findPlanLabels
@NotNull public @NotNull Set<Label> findPlanLabels(String namespace)
Description copied from interface:LabelDao
Finds labels that are *only* plan level labellings matching the namespace. No duplicates in the returned set (obviously)- Specified by:
findPlanLabels
in interfaceLabelDao
- Parameters:
namespace
- label namespace- Returns:
- set of labels
-
findPlanLabels
@NotNull public @NotNull Set<Label> findPlanLabels(String namespace, @NotNull @NotNull PlanIdentifier plan)
Description copied from interface:LabelDao
Finds labels that are *only* plan level labellings matching the namespace and associated with a plan. No duplicates in the returned set (obviously)- Specified by:
findPlanLabels
in interfaceLabelDao
- Parameters:
namespace
- label namespaceplan
- plan to filter labels with- Returns:
- set of labels
-
findLabels
@NotNull public @NotNull List<LabelCount> findLabels(String namespace, int maxResults, Plan plan)
- Specified by:
findLabels
in interfaceLabelDao
-
findLabels
@NotNull public @NotNull List<LabelCount> findLabels(String namespace, int maxResults, Project project)
- Specified by:
findLabels
in interfaceLabelDao
-
findLabels
@NotNull public @NotNull List<Labelling> findLabels(ImmutablePlan plan)
- Specified by:
findLabels
in interfaceLabelDao
-
findLabels
@NotNull public @NotNull List<Labelling> findLabels(Project project)
- Specified by:
findLabels
in interfaceLabelDao
-
findLabellingByUser
@NotNull public @NotNull List<Labelling> findLabellingByUser(String userName)
- Specified by:
findLabellingByUser
in interfaceLabelDao
-
saveLabel
public void saveLabel(@NotNull @NotNull Label label)
-
saveLabelling
public void saveLabelling(@NotNull @NotNull Labelling labelling)
- Specified by:
saveLabelling
in interfaceLabelDao
-
remove
public void remove(@NotNull @NotNull Labelling labelling)
Description copied from interface:LabelDao
Removes the labelling from the persistent layer
-
getResultSummaryLabelNames
@NotNull public @NotNull Set<String> getResultSummaryLabelNames(@NotNull @NotNull ResultsSummary resultsSummary)
Description copied from interface:LabelDao
Get names of labels related to result summary- Specified by:
getResultSummaryLabelNames
in interfaceLabelDao
- Parameters:
resultsSummary
- result summary- Returns:
- set of unique label names
-
-