com.atlassian.bamboo.plan
Interface PlanDao

All Superinterfaces:
BambooObjectDao<Plan>
All Known Implementing Classes:
PlanHibernateDao

public interface PlanDao
extends BambooObjectDao<Plan>

DAO Manager for Plan


Method Summary
 java.util.Set<TopLevelPlan> filterFavouritedPlans(java.util.Collection<TopLevelPlan> plans, com.atlassian.user.User user)
          Return a collection of TopLevelPlans that are a subset of the given Builds collection that are favourited by the User
<T extends Plan>
java.util.List<T>
findAllPlans(java.lang.Class<T> planType)
          Return a Plan collection for specified plan type
<T extends Plan>
java.util.List<T>
findAllPlansByProject(Project project, java.lang.Class<T> planType)
          Return a Plan collection for specified Project, including plans marked for deletion.
<T extends Plan>
java.util.List<T>
findPlansByProject(Project project, java.lang.Class<T> planType)
          Return a Plan collection for specified Project
<T extends Plan>
java.util.Collection<T>
getAllPlansMarkedForDeletion(java.lang.Class<T> planType)
          Returns a list of Plans that are com.atlassian.bamboo.plan.Plan#markForDeletion() for the given type
<T extends Plan>
T
getPlanByKey(java.lang.String planKey, java.lang.Class<T> aClass)
          Return a Plan that matches the given key
<T extends Plan>
T
getPlanByName(java.lang.String projectKey, java.lang.String planName, java.lang.Class<T> planType)
          Returns a Plan from a project with the given plan name and Class It is not possible to use this method if the planType parameter is a marker interface type such as Plan, Buildable or TopLevelPlan since it is possible to have a Chain and a Job that share the same name.
<T extends Plan>
T
getPlanByPartialKeyAndName(PlanKey partialPlanKey, java.lang.String planName, java.lang.Class<T> planType)
          Returns a Plan that matches the start of the given PlanKey and name
<T extends Plan>
int
getPlanCount(java.lang.Class<T> planType)
          How many plans filtered by Class currently exist
 
Methods inherited from interface com.atlassian.bamboo.persistence3.BambooObjectDao
delete, executeReturnLong, findAll, findById, save
 

Method Detail

getPlanByKey

@Nullable
<T extends Plan> T getPlanByKey(@NotNull
                                         java.lang.String planKey,
                                         java.lang.Class<T> aClass)
Return a Plan that matches the given key

Parameters:
planKey -
Returns:
plan

getPlanByName

@Nullable
<T extends Plan> T getPlanByName(@NotNull
                                          java.lang.String projectKey,
                                          @NotNull
                                          java.lang.String planName,
                                          java.lang.Class<T> planType)
Returns a Plan from a project with the given plan name and Class It is not possible to use this method if the planType parameter is a marker interface type such as Plan, Buildable or TopLevelPlan since it is possible to have a Chain and a Job that share the same name.

Parameters:
projectKey - of the project to look for the plan in
planName - - name of the plan inside the project: this is just the plan component of the name (i.e does not include the project component)
planType - - the type of the plan to retrieve
Returns:
plan with the given name and project key, if found AND is of the correct type.
Throws:
IncorrectPlanTypeException - if the result cannot be guaranteed to be unique

getPlanByPartialKeyAndName

@Nullable
<T extends Plan> T getPlanByPartialKeyAndName(@NotNull
                                                       PlanKey partialPlanKey,
                                                       @NotNull
                                                       java.lang.String planName,
                                                       java.lang.Class<T> planType)
Returns a Plan that matches the start of the given PlanKey and name

Parameters:
partialPlanKey -
planName -
planType -
Returns:
plan

getPlanCount

<T extends Plan> int getPlanCount(java.lang.Class<T> planType)
How many plans filtered by Class currently exist

Parameters:
planType -
Returns:
how many plans exist in the datbase

findPlansByProject

<T extends Plan> java.util.List<T> findPlansByProject(@NotNull
                                                      Project project,
                                                      java.lang.Class<T> planType)
Return a Plan collection for specified Project

Parameters:
project -
planType -
Returns:
plans for specifid project

findAllPlansByProject

<T extends Plan> java.util.List<T> findAllPlansByProject(@NotNull
                                                         Project project,
                                                         java.lang.Class<T> planType)
Return a Plan collection for specified Project, including plans marked for deletion.

Parameters:
project -
planType -
Returns:
plans for specifid project

findAllPlans

@NotNull
<T extends Plan> java.util.List<T> findAllPlans(java.lang.Class<T> planType)
Return a Plan collection for specified plan type

Type Parameters:
T -
Parameters:
planType - type of plan to be selected from DB
Returns:
Plan collection for specified plan type

filterFavouritedPlans

java.util.Set<TopLevelPlan> filterFavouritedPlans(@NotNull
                                                  java.util.Collection<TopLevelPlan> plans,
                                                  @NotNull
                                                  com.atlassian.user.User user)
Return a collection of TopLevelPlans that are a subset of the given Builds collection that are favourited by the User

Parameters:
plans -
user -
Returns:
favoritedBuilds

getAllPlansMarkedForDeletion

@NotNull
<T extends Plan> java.util.Collection<T> getAllPlansMarkedForDeletion(java.lang.Class<T> planType)
Returns a list of Plans that are com.atlassian.bamboo.plan.Plan#markForDeletion() for the given type

Returns:
plansMarkedForDeletion


Copyright © 2010 Atlassian. All Rights Reserved.