com.atlassian.bamboo.plugins.rest.service
Interface PlanService

All Known Implementing Classes:
PlanServiceImpl

public interface PlanService


Method Summary
 void assertPlanExistsAndVisible(PlanKey planKey)
          Checks if Plan exists and is visible for calling user
 RestBranchLatestActive createLatestActiveBranchResult(ImmutablePlan branch)
           
 RestPlanBranchList createPaginatedBranchResponse(java.util.List<? extends ImmutablePlan> branches, com.atlassian.user.User user, javax.ws.rs.core.UriInfo uriInfo)
           
 RestPlans createPaginatedPlanResponse(java.util.List<? extends ImmutablePlan> plans, com.atlassian.user.User user, javax.ws.rs.core.UriInfo uriInfo)
           
 ImmutablePlan getBranchByName(ImmutablePlan plan, java.lang.String branchName)
          Get branch of a given plan by name.
 java.util.List<ImmutableChainBranch> getBranchesForChain(ImmutablePlan plan)
           
 java.util.List<ImmutableJob> getBranchesForJob(Job job)
           
 ImmutableChain getChainByKey(PlanKey planKey)
          Returns a Plan if plan exists and is visible for calling user
 ImmutablePlan getPlanByKey(PlanKey planKey)
          Returns a Plan if plan exists and is visible for calling user
 ImmutablePlan getPlanByKeyUnchecked(PlanKey planKey)
          Returns a Plan if plan exists.
 java.util.List<? extends ImmutablePlan> getPlans(javax.ws.rs.core.UriInfo uriInfo, com.atlassian.plugins.rest.common.security.AuthenticationContext authenticationContext)
          Get a list of plans.
 java.util.List<? extends ImmutablePlan> getPlansByProject(Project project, javax.ws.rs.core.UriInfo uriInfo)
          Get a list of plans that belong to a project.
 java.util.List<? extends ImmutablePlan> getPlansByProject(Project project, javax.ws.rs.core.UriInfo uriInfo, com.atlassian.plugins.rest.common.security.AuthenticationContext authenticationContext)
          Get a list of plans that belong to a project.
 java.util.List<? extends ImmutablePlan> getRunnablePlans(Project project, javax.ws.rs.core.UriInfo uriInfo)
          Get a list of plans that can be run currently logged in user.
 boolean isPlanCreationAllowed()
          Check whether or not a plan can be created or not (based on licensing etc)
 

Method Detail

getBranchesForChain

java.util.List<ImmutableChainBranch> getBranchesForChain(ImmutablePlan plan)

getBranchesForJob

java.util.List<ImmutableJob> getBranchesForJob(Job job)

createPaginatedBranchResponse

RestPlanBranchList createPaginatedBranchResponse(java.util.List<? extends ImmutablePlan> branches,
                                                 @Nullable
                                                 com.atlassian.user.User user,
                                                 javax.ws.rs.core.UriInfo uriInfo)

createLatestActiveBranchResult

@Nullable
RestBranchLatestActive createLatestActiveBranchResult(ImmutablePlan branch)

getBranchByName

@Nullable
ImmutablePlan getBranchByName(@NotNull
                                       ImmutablePlan plan,
                                       @NotNull
                                       java.lang.String branchName)
Get branch of a given plan by name. If passed plan is Chain method will look after properly named chain branch. If passed plan is a Job method will look after corresponding job in a found chain branch.

Parameters:
plan - plan
branchName - name of the branch to be fetched
Returns:
ImmutableChainBranch, ImmutableJob or null if not found

createPaginatedPlanResponse

RestPlans createPaginatedPlanResponse(java.util.List<? extends ImmutablePlan> plans,
                                      @Nullable
                                      com.atlassian.user.User user,
                                      javax.ws.rs.core.UriInfo uriInfo)

getPlans

java.util.List<? extends ImmutablePlan> getPlans(@NotNull
                                                 javax.ws.rs.core.UriInfo uriInfo,
                                                 @NotNull
                                                 com.atlassian.plugins.rest.common.security.AuthenticationContext authenticationContext)
Get a list of plans. This method provides favourite filtering.

Parameters:
uriInfo -
authenticationContext -
Returns:
Filtered list of plans belonging to a project.

getPlansByProject

java.util.List<? extends ImmutablePlan> getPlansByProject(@NotNull
                                                          Project project,
                                                          @NotNull
                                                          javax.ws.rs.core.UriInfo uriInfo)
Get a list of plans that belong to a project.

Parameters:
project -
uriInfo -
Returns:
Filtered list of plans belonging to a project.

getPlansByProject

java.util.List<? extends ImmutablePlan> getPlansByProject(@NotNull
                                                          Project project,
                                                          @NotNull
                                                          javax.ws.rs.core.UriInfo uriInfo,
                                                          @NotNull
                                                          com.atlassian.plugins.rest.common.security.AuthenticationContext authenticationContext)
Get a list of plans that belong to a project. This method provides favourite filtering.

Parameters:
project -
uriInfo -
authenticationContext -
Returns:
Filtered list of plans belonging to a project.

getRunnablePlans

java.util.List<? extends ImmutablePlan> getRunnablePlans(@NotNull
                                                         Project project,
                                                         @NotNull
                                                         javax.ws.rs.core.UriInfo uriInfo)
Get a list of plans that can be run currently logged in user.

Parameters:
project -
uriInfo -
Returns:

assertPlanExistsAndVisible

void assertPlanExistsAndVisible(@NotNull
                                PlanKey planKey)
Checks if Plan exists and is visible for calling user

Parameters:
planKey -
Throws:
NotFoundException, - AccessDeniedException

getChainByKey

@NotNull
ImmutableChain getChainByKey(@NotNull
                                     PlanKey planKey)
Returns a Plan if plan exists and is visible for calling user

Parameters:
planKey -
Returns:
Throws:
NotFoundException, - AccessDeniedException

getPlanByKey

@NotNull
ImmutablePlan getPlanByKey(@NotNull
                                   PlanKey planKey)
Returns a Plan if plan exists and is visible for calling user

Parameters:
planKey - key of a plan to search for
Returns:
ImmutablePlan
Throws:
NotFoundException - when plan was not found
org.acegisecurity.AccessDeniedException - when authenticated user has no permission to the plan

getPlanByKeyUnchecked

@Nullable
ImmutablePlan getPlanByKeyUnchecked(@NotNull
                                             PlanKey planKey)
Returns a Plan if plan exists. No permission check is performed.

Parameters:
planKey - key of a plan to search for
Returns:
ImmutablePlan or null if not found

isPlanCreationAllowed

boolean isPlanCreationAllowed()
Check whether or not a plan can be created or not (based on licensing etc)

Returns:
true if a plan can be created otherwise false;


Copyright © 2012 Atlassian. All Rights Reserved.