Interface CachedDeploymentProjectService

All Known Implementing Classes:
CachedDeploymentProjectServiceImpl

@ExperimentalApi public interface CachedDeploymentProjectService
Cache for deployment projects. Provides methods to retrieve and manage deployment projects with caching mechanisms.
Since:
11.0
  • Method Details

    • getDeploymentProject

      @Nullable @Nullable DeploymentProject getDeploymentProject(long id) throws org.acegisecurity.AccessDeniedException
      Retrieves a deployment project by its ID.
      Parameters:
      id - of the deployment project to retrieve
      Returns:
      deployment project with the given id or null if none found.
      Throws:
      org.acegisecurity.AccessDeniedException - if access to the deployment project is denied
    • getDeploymentProjectForEnvironment

      @Nullable @Nullable DeploymentProject getDeploymentProjectForEnvironment(long environmentId)
      Retrieve the deployment project that a specific environment belongs to.
      Parameters:
      environmentId - of the environment
      Returns:
      DeploymentProject environment belongs to
    • getAllDeploymentProjects

      @NotNull @NotNull List<DeploymentProject> getAllDeploymentProjects()
      Retrieves a list of all deployment projects, filtered by permissions and decorated with operations, sorted by name (case-insensitive).
      Returns:
      a list of all deployment projects
    • getAllDeploymentProjects

      @NotNull @NotNull List<DeploymentProject> getAllDeploymentProjects(boolean sorted)
      Retrieves a list of all deployment projects, filtered by permissions and decorated with operations.
      Parameters:
      sorted - if true, the result will be sorted by name (case-insensitive)
      Returns:
      a list of all deployment projects
    • getAllInternalDeploymentProjects

      @NotNull @NotNull List<InternalDeploymentProject> getAllInternalDeploymentProjects()
      Retrieves a list of all deployment projects, unfiltered, undecorated, and unsorted.
      Returns:
      a list of all internal deployment projects
    • getDeploymentProjectsRelatedToPlan

      @NotNull @NotNull List<DeploymentProject> getDeploymentProjectsRelatedToPlan(@NotNull @NotNull PlanKey planKey)
      Retrieve the deployment projects that are linked to a specific plan
      Parameters:
      planKey - of the linked plan
      Returns:
      a list of all deployment projects linked to a specified plan
    • getInternalDeploymentProjectsRelatedToPlan

      @NotNull @NotNull List<InternalDeploymentProject> getInternalDeploymentProjectsRelatedToPlan(@NotNull @NotNull PlanKey planKey)
      Retrieves a list of deployment projects related to a specific plan.
      Parameters:
      planKey - the key of the plan
      Returns:
      a list of related deployment projects
    • getInternalDeploymentProjectsRelatedToPlansAndBranches

      @NotNull @NotNull List<InternalDeploymentProject> getInternalDeploymentProjectsRelatedToPlansAndBranches(@NotNull @NotNull PlanKey masterOrBranchKey)
      Retrieve list of deployment projects associated with any of the branches in the plan. The result includes divergent branches.
      Parameters:
      masterOrBranchKey - identifies master plan or branch
      Returns:
      list of deployment projects
    • getInternalDeploymentProjectsRelatedToPlanConfiguration

      @NotNull @NotNull List<InternalDeploymentProject> getInternalDeploymentProjectsRelatedToPlanConfiguration(@NotNull @NotNull PlanKey masterOrBranchPlanKey)
      Retrieve the deployment projects that are linked to a specific plan configuration, taking branch divergence into account. If the argument is a master plan or a lightweight branch, deployments linked to the master plan and lightweight branches are returned. If the argument is a divergent branch, only deployments linked to that particular branch will be returned.
      Parameters:
      masterOrBranchPlanKey - identifies master plan or branch
      Returns:
      a list of all deployment projects linked to a specified plan or any of its branches
    • getInternalDeploymentProjectsRelatedToArtifact

      @NotNull @NotNull List<InternalDeploymentProject> getInternalDeploymentProjectsRelatedToArtifact(@NotNull @NotNull ArtifactDefinition artifactDefinition)
      Retrieves a list of internal deployment projects related to a specific artifact definition.
      Parameters:
      artifactDefinition - the artifact definition to search for related deployment projects
      Returns:
      a list of internal deployment projects related to the specified artifact definition
    • getInternalDeploymentProjectsReferencingArtifact

      @NotNull @NotNull List<InternalDeploymentProject> getInternalDeploymentProjectsReferencingArtifact(@NotNull @NotNull Artifact artifact)
      Retrieves a list of internal deployment projects referencing a specific artifact.
      Parameters:
      artifact - the artifact to search for related deployment projects
      Returns:
      a list of internal deployment projects related to the specified artifact definition
    • initialiseCache

      void initialiseCache()
      Initializes the cache. Do NOT call this method multiple times; cache can be initialized only once.
    • remove

      void remove(long deploymentProjectId)
      Removes a deployment project from the cache by its ID.
      Parameters:
      deploymentProjectId - the ID of the deployment project to remove
    • refresh

      void refresh(long deploymentProjectId)
      Refreshes the cache for the given deployment project by its ID.
      Parameters:
      deploymentProjectId - the ID of the deployment project to remove
    • getCacheStats

      @NotNull @NotNull BambooCacheStats getCacheStats()
      Retrieve cache statistics
      Returns:
      Cache statistics
    • getEnvironmentDecorator

      @NotNull @NotNull Function<Environment,DecoratedEnvironment> getEnvironmentDecorator()
      Create environment decorator function object. Instances should be used for a single stream operation and should not live long. The function will return null if the user is not allowed to see the corresponding deployment project.
    • findEnvironmentsByRequirementKey

      @NotNull @NotNull Set<RequirementDeploymentMapping> findEnvironmentsByRequirementKey(@NotNull @NotNull String requirementKey)
      Find environments which rely on requirementKey
      Parameters:
      requirementKey - on which environments rely
      Returns:
      environments or empty set
    • getDeploymentProjectCount

      long getDeploymentProjectCount()
      Returns:
      count of all deployment projects
    • resetTriggers

      void resetTriggers(@NotNull @NotNull PlanKey newPlanKey)
      Delete and recreate the triggers for every deployment that's related to this planKey.
    • getPaginatedDeploymentsWithEnvironments

      @Internal @NotNull @NotNull DeploymentProjectWithEnvironmentForDashboard getPaginatedDeploymentsWithEnvironments(int start, int limit, @Nullable @Nullable String filter)
      Retrieve paginated view of DeploymentProject and Environment and information if there are more entries ordered by InternalDeploymentProject.getName() and InternalEnvironment.getPosition(). Deployment projects are not operation aware, environments are. In case of null or empty filter no filtering.
    • getEnvironmentsMatchingCapabilities

      @Internal @NotNull @NotNull PaginatedEnvironmentsForExecutablesView getEnvironmentsMatchingCapabilities(int start, int limit, @Nullable @Nullable String filter, @NotNull @NotNull ReadOnlyCapabilitySet agentCapabilities, @NotNull @NotNull Iterable<AgentAssignmentService.AgentAssignmentExecutor> agentAssignmentExecutors)
      Provide a paginated list of minimal information about deployment environments matching agent capabilities.
      Parameters:
      start - start by index
      limit - return no more entries than limit
      filter - filter
      agentCapabilities - capabilities of an agent
      agentAssignmentExecutors - executors of agent assignment
      Returns:
      List of ids and name of deployment projects and environments, sorted alphabetically by deployment name and environment position;
    • getDeploymentProjectsWithStatusesRelatedToPlanOrBranches

      @NotNull @NotNull List<DeploymentProjectWithEnvironmentStatuses> getDeploymentProjectsWithStatusesRelatedToPlanOrBranches(@NotNull @NotNull PlanKey masterOrBranchPlanKey)
      Retrieve the deployment projects that are linked to a specific plan or any of its branches. Includes projects their environments + latest status
      Parameters:
      masterOrBranchPlanKey - identifies master plan or branch
      Returns:
      a list of all deployment projects linked to a specified plan or any of its branches
    • getDeploymentProjectsWithStatusesRelatedToPlanResult

      @NotNull @NotNull List<DeploymentProjectStatusForResultSummary> getDeploymentProjectsWithStatusesRelatedToPlanResult(@NotNull @NotNull ResultsSummary resultsSummary)
      Retrieve the deployment projects that are linked to a specific result. Includes projects their environments + latest status
      Parameters:
      resultsSummary - of the linked plan
      Returns:
      a list of all deployment projects linked to a specified plan