Class PlanRestServiceImpl

    • Method Detail

      • createPaginatedBranchResponse

        public RestPlanBranchList createPaginatedBranchResponse​(List<? extends ImmutablePlan> branches,
                                                                @Nullable
                                                                @Nullable com.atlassian.user.User user,
                                                                javax.ws.rs.core.UriInfo uriInfo,
                                                                boolean allBranches)
        Specified by:
        createPaginatedBranchResponse in interface PlanRestService
        allBranches - return all branches, even if expand has 'favourites' parameter. This is because 'favourites' is about plans not branches and all branches of a favourite plan are to be shown
        Returns:
        filtered list of branches
      • getBranchByName

        @Nullable
        public @Nullable ImmutablePlan getBranchByName​(@NotNull
                                                       @NotNull ImmutablePlan plan,
                                                       @NotNull
                                                       @NotNull String branchName)
        Description copied from interface: PlanRestService
        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.
        Specified by:
        getBranchByName in interface PlanRestService
        Parameters:
        plan - plan
        branchName - name of the branch to be fetched
        Returns:
        ImmutableChainBranch, ImmutableJob or null if not found
      • getPlans

        public List<ImmutablePlan> getPlans​(@NotNull
                                            @NotNull javax.ws.rs.core.UriInfo uriInfo,
                                            @NotNull
                                            @NotNull com.atlassian.plugins.rest.common.security.AuthenticationContext authenticationContext)
        Description copied from interface: PlanRestService
        Get a list of plans. This method provides filtering using the following query params:
        favourite
        if specified return only favourite plans
        permission
        if specified return only plans that user has this specific permission for
        type
        if specifies return only plans of specified type
        Specified by:
        getPlans in interface PlanRestService
        Returns:
        Filtered list of plans belonging to a project.
      • getPlans

        public <T extends ImmutablePlanList<T> getPlans​(Class<T> planType,
                                                          @NotNull
                                                          @NotNull javax.ws.rs.core.UriInfo uriInfo,
                                                          @NotNull
                                                          @NotNull com.atlassian.plugins.rest.common.security.AuthenticationContext authenticationContext)
        Description copied from interface: PlanRestService
        Get a list of plans. This method provides filtering using the following query params:
        favourite
        if specified return only favourite plans
        permission
        if specified return only plans that user has this specific permission for
        Specified by:
        getPlans in interface PlanRestService
        Parameters:
        planType - type of plans
        Returns:
        Filtered list of plans belonging to a project.
      • getJobsForPlan

        public List<ImmutableJob> getJobsForPlan​(@NotNull
                                                 @NotNull PlanKey planKey,
                                                 @NotNull
                                                 @NotNull javax.ws.rs.core.UriInfo uriInfo,
                                                 @NotNull
                                                 @NotNull com.atlassian.plugins.rest.common.security.AuthenticationContext authenticationContext)
        Description copied from interface: PlanRestService
        Get a list of jobs of specified plan.
        Specified by:
        getJobsForPlan in interface PlanRestService
        Parameters:
        planKey - planKey
        Returns:
        Filtered list of jobs belonging to a plan.
      • getStagesForPlan

        public List<ImmutableChainStage> getStagesForPlan​(@NotNull
                                                          @NotNull PlanKey planKey,
                                                          @NotNull
                                                          @NotNull javax.ws.rs.core.UriInfo uriInfo,
                                                          @NotNull
                                                          @NotNull com.atlassian.plugins.rest.common.security.AuthenticationContext authenticationContext)
        Description copied from interface: PlanRestService
        Get a list of stages of specified plan.
        Specified by:
        getStagesForPlan in interface PlanRestService
        Parameters:
        planKey - planKey
        Returns:
        Filtered list of stages belonging to a plan.
      • getPlansByProject

        public List<ImmutablePlan> getPlansByProject​(@NotNull
                                                     @NotNull Project project,
                                                     @NotNull
                                                     @NotNull javax.ws.rs.core.UriInfo uriInfo)
        Description copied from interface: PlanRestService
        Get a list of plans that belong to a project.
        Specified by:
        getPlansByProject in interface PlanRestService
        Returns:
        Filtered list of plans belonging to a project.
      • getPlansByProject

        public List<ImmutablePlan> getPlansByProject​(@NotNull
                                                     @NotNull Project project,
                                                     @NotNull
                                                     @NotNull javax.ws.rs.core.UriInfo uriInfo,
                                                     @NotNull
                                                     @NotNull com.atlassian.plugins.rest.common.security.AuthenticationContext authenticationContext)
        Description copied from interface: PlanRestService
        Get a list of plans that belong to a project. This method provides favourite filtering.
        Specified by:
        getPlansByProject in interface PlanRestService
        Returns:
        Filtered list of plans belonging to a project.
      • getRunnablePlans

        public List<ImmutablePlan> getRunnablePlans​(@NotNull
                                                    @NotNull Project project,
                                                    @NotNull
                                                    @NotNull javax.ws.rs.core.UriInfo uriInfo)
        Description copied from interface: PlanRestService
        Get a list of plans that can be run currently logged in user.
        Specified by:
        getRunnablePlans in interface PlanRestService
        Returns:
        A list of plans that the current user can run.
      • getPlanByKey

        @NotNull
        public @NotNull ImmutablePlan getPlanByKey​(@NotNull
                                                   @NotNull PlanKey planKey)
        Description copied from interface: PlanRestService
        Returns a Plan if plan exists and is visible for calling user In clustered mode, there is NO consistency guarantee.
        Specified by:
        getPlanByKey in interface PlanRestService
        Parameters:
        planKey - key of a plan to search for
        Returns:
        ImmutablePlan
      • isPlanCreationAllowed

        public boolean isPlanCreationAllowed()
        Description copied from interface: PlanRestService
        Check whether or not a plan can be created or not (based on licensing etc)
        Specified by:
        isPlanCreationAllowed in interface PlanRestService
        Returns:
        true if a plan can be created otherwise false;