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 Summary
Modifier and TypeMethodDescription@NotNull Set<RequirementDeploymentMapping>findEnvironmentsByRequirementKey(@NotNull String requirementKey) Find environments which rely on requirementKey@NotNull List<DeploymentProject>Retrieves a list of all deployment projects, filtered by permissions and decorated with operations, sorted by name (case-insensitive).@NotNull List<DeploymentProject>getAllDeploymentProjects(boolean sorted) Retrieves a list of all deployment projects, filtered by permissions and decorated with operations.@NotNull List<InternalDeploymentProject>Retrieves a list of all deployment projects, unfiltered, undecorated, and unsorted.@NotNull BambooCacheStatsRetrieve cache statistics@Nullable DeploymentProjectgetDeploymentProject(long id) Retrieves a deployment project by its ID.long@Nullable DeploymentProjectgetDeploymentProjectForEnvironment(long environmentId) Retrieve the deployment project that a specific environment belongs to.@NotNull List<DeploymentProject>getDeploymentProjectsRelatedToPlan(@NotNull PlanKey planKey) Retrieve the deployment projects that are linked to a specific plan@NotNull List<DeploymentProjectWithEnvironmentStatuses>getDeploymentProjectsWithStatusesRelatedToPlanOrBranches(@NotNull PlanKey masterOrBranchPlanKey) Retrieve the deployment projects that are linked to a specific plan or any of its branches.@NotNull List<DeploymentProjectStatusForResultSummary>getDeploymentProjectsWithStatusesRelatedToPlanResult(@NotNull ResultsSummary resultsSummary) Retrieve the deployment projects that are linked to a specific result.@NotNull Function<Environment,DecoratedEnvironment> Create environment decorator function object.getEnvironmentsMatchingCapabilities(int start, int limit, @Nullable String filter, @NotNull ReadOnlyCapabilitySet agentCapabilities, @NotNull Iterable<AgentAssignmentService.AgentAssignmentExecutor> agentAssignmentExecutors) Provide a paginated list of minimal information about deployment environments matching agent capabilities.@NotNull List<InternalDeploymentProject>getInternalDeploymentProjectsReferencingArtifact(@NotNull Artifact artifact) Retrieves a list of internal deployment projects referencing a specific artifact.@NotNull List<InternalDeploymentProject>getInternalDeploymentProjectsRelatedToArtifact(@NotNull ArtifactDefinition artifactDefinition) Retrieves a list of internal deployment projects related to a specific artifact definition.@NotNull List<InternalDeploymentProject>getInternalDeploymentProjectsRelatedToPlan(@NotNull PlanKey planKey) Retrieves a list of deployment projects related to a specific plan.@NotNull List<InternalDeploymentProject>getInternalDeploymentProjectsRelatedToPlanConfiguration(@NotNull PlanKey masterOrBranchPlanKey) Retrieve the deployment projects that are linked to a specific plan configuration, taking branch divergence into account.@NotNull List<InternalDeploymentProject>getInternalDeploymentProjectsRelatedToPlansAndBranches(@NotNull PlanKey masterOrBranchKey) Retrieve list of deployment projects associated with any of the branches in the plan.getPaginatedDeploymentsWithEnvironments(int start, int limit, @Nullable String filter) Retrieve paginated view of DeploymentProject and Environment and information if there are more entries ordered byInternalDeploymentProject.getName()andInternalEnvironment.getPosition().voidInitializes the cache.voidrefresh(long deploymentProjectId) Refreshes the cache for the given deployment project by its ID.voidremove(long deploymentProjectId) Removes a deployment project from the cache by its ID.voidresetTriggers(@NotNull PlanKey newPlanKey) Delete and recreate the triggers for every deployment that's related to this planKey.
-
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
Retrieve the deployment project that a specific environment belongs to.- Parameters:
environmentId- of the environment- Returns:
- DeploymentProject environment belongs to
-
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
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
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
Retrieve cache statistics- Returns:
- Cache statistics
-
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
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 byInternalDeploymentProject.getName()andInternalEnvironment.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 indexlimit- return no more entries than limitfilter- filteragentCapabilities- capabilities of an agentagentAssignmentExecutors- 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
-