Class EnvironmentServiceImpl
- java.lang.Object
-
- com.atlassian.bamboo.deployments.environments.service.EnvironmentServiceImpl
-
- All Implemented Interfaces:
EnvironmentService
public class EnvironmentServiceImpl extends Object implements EnvironmentService
-
-
Field Summary
-
Fields inherited from interface com.atlassian.bamboo.deployments.environments.service.EnvironmentService
DEFAULT_ARTIFACT_TASK_NAME
-
-
Constructor Summary
Constructors Constructor Description EnvironmentServiceImpl(BambooAclUpdateHelper aclUpdateHelper, HibernateMutableAclService aclService, AuditLogService auditLogService, BambooAuthenticationContext authenticationContext, DeploymentProjectDao deploymentProjectDao, EnvironmentDao environmentDao, EnvironmentRepositoryLinkDao environmentRepositoryLinkDao, PlanScheduler planScheduler, RepositoryDefinitionDao repositoryDefinitionDao, ScopedExclusionService scopedExclusionService, com.opensymphony.xwork2.TextProvider textProvider, ValidationService validationService, com.atlassian.event.api.EventPublisher eventPublisher, DeploymentVersionLinkedJiraIssueDao deploymentVersionLinkedJiraIssueDao, NotificationManager notificationManager, VariableConfigurationService variableConfigurationService, VariableDefinitionManager variableDefinitionManager, TriggerTypeManager triggerTypeManager, RepositoryDefinitionManager repositoryDefinitionManager, BambooCachingPermissionManagerFacadeFactory cachingPermissionManagerFacadeFactory, CapabilityRequirementsMatcher capabilityRequirementsMatcher, InternalEnvironmentService internalEnvironmentService)
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description @NotNull EnvironmentaddEnvironment(long deploymentProjectId, @Nullable String name, @Nullable String description, @Nullable ReleaseApprovalPrerequisite releaseApprovalPrerequisite)Creates a new environment in the specified deployment project.voidaddNotification(long environmentId, @NotNull NotificationRule newRule)Adds a new notification to the environment notifications@NotNull EnvironmentcloneEnvironment(long deploymentProjectId, long environmentId, @Nullable String name, @Nullable String description)Create new environment as a clone of existing one@NotNull EnvironmentcloneEnvironment(long deploymentProjectId, long environmentId, @Nullable String name, @Nullable String description, @NotNull Map<String,String> oldAndClonedEnvironmentIds)Create new environment as a clone of existing one and if necessary update triggers' configurationlongcountAll()@NotNull EnvironmentcreateImmutableEnvironment(@NotNull MutableEnvironment mutableEnvironment)Converts mutable environment to immutable.@NotNull EnvironmentcreateOperationsAwareImmutableEnvironment(@NotNull MutableEnvironment environment)Create operation aware immutable environmentprotected @NotNull EnvironmentcreateOperationsAwareImmutableEnvironment(Environment environment)voiddeleteNotification(long environmentId, long notificationId)Removes notification from the environment's notification set.@NotNull EnvironmenteditEnvironment(long environmentId, String name, String description)Edit the details of an existing environment@NotNull EnvironmenteditEnvironment(long environmentId, String name, String description, @Nullable ReleaseApprovalPrerequisite releaseApprovalPrerequisite)Edit the details of an existing environment@Nullable EnvironmentfindEnvironmentByName(long deploymentProjectId, String name)Find environment with specified name in a deployment project@NotNull Set<RequirementDeploymentMapping>findEnvironmentsByRequirementKey(@NotNull String requirementKey)Find environments which rely on requirementKey@NotNull Iterable<Environment>getAllEnvironments()Retrieve allEnvironmentdefined in the system.@NotNull Collection<Environment>getAllEnvironmentsForDashboard()Retrieve allEnvironmentdefined in the system.@NotNull Iterable<Environment>getAllEnvironmentsNoUserContext()Retrieve allEnvironmentdefined in the system without filling in operations permitted for the user.Iterable<Environment>getAllEnvironmentsNoUserContext(int firstResult, int pageSize)Retrieve allEnvironmentdefined in the system without filling in operations permitted for the user.Iterable<InternalEnvironment>getAllInternalEnvironmentsNoUserContext(int firstResult, int maxResults)Retrieve allEnvironmentdefined in the system without filling in operations permitted for the user.@Nullable EnvironmentgetEnvironment(long environmentId)Get specific environment by ID.intgetEnvironmentCount()intgetEnvironmentCountForProject(DeploymentProject deploymentProject)Function<Environment,DecoratedEnvironment>getEnvironmentDecorator()Create environment decorator function object.List<EnvironmentRepositoryLink>getEnvironmentRepositoryLinksForRepository(long repositoryId)@Nullable RequirementSetgetEnvironmentRequirementSet(long environmentId)Retrieve Agent Requirement set for environment, if environment with id exists.@NotNull List<Environment>getEnvironmentsForDeploymentProject(long deploymentProjectId)Get all environments for a particular deployment project.@NotNull PaginatedEnvironmentsForExecutablesViewgetEnvironmentsMatchingCapabilities(int start, int limit, @Nullable String filter, @NotNull ReadOnlyCapabilitySet agentCapabilities)Provide a paginated list of minimal information about deployment environments matching agent capabilities.@NotNull PaginatedEnvironmentsForExecutablesViewgetEnvironmentsMatchingCapabilities(int start, int limit, @Nullable String filter, @NotNull ReadOnlyCapabilitySet agentCapabilities, @NotNull Iterable<AgentAssignmentService.AgentAssignmentExecutor> executors)Provide a paginated list of minimal information about deployment environments matching agent capabilities.@NotNull List<EnvironmentStub>getEnvironmentStubsForDeploymentProject(long deploymentProjectId)Get all environment stubs for a particular deployment project.List<EnvironmentRepositoryLink>getEnvironmentsUsingRepository(long repositoryId)List<Environment>getEnvironmentsUsingRepositoryDataEntity(long repositoryId)TODO 6.0 rename to getEnvironmentsUsingRepository@Nullable EnvironmentgetEnvironmentUnrestricted(long environmentId)Get specific environment by ID.NotificationSetgetNotificationSet(long environmentId)Retrieve notification set for environment, if environment with id exists.@NotNull PaginatedEnvironmentsForDashboardgetPaginatedEnvironmentsForDeploymentProject(long deploymentProjectId, int start, int limit, @Nullable String filter)Get paginated environments for a particular deployment project ordered by position.@NotNull List<PlanRepositoryDefinition>getPlanRepositoryDefinitionsForEnvironment(@NotNull Environment environment)Retrieves all repositories used in environment source checkout tasks@NotNull List<PlanRepositoryDefinition>getPlanRepositoryDefinitionsForEnvironment(@NotNull InternalEnvironment environment)Retrieves all repositories used in environment source checkout tasks@NotNull List<RepositoryDefinition>getRepositoryDefinitionsForEnvironment(@NotNull Environment environment)Retrieves all repositories used in environment source checkout tasksErrorCollectionmoveEnvironment(MoveEnvironmentStrategy moveEnvironmentStrategy, long deploymentProjectId, long environmentId, int currentPosition, Optional<Long> relatedEnvId)Move Environment in given deploymentProject with given strategy.@NotNull ErrorCollectionmoveEnvironmentDown(long deploymentProjectId, long environmentId, int currentPosition)Moves an environment down the list@NotNull ErrorCollectionmoveEnvironmentUp(long deploymentProjectId, long environmentId, int currentPosition)Moves an environment up the listvoidremoveRepositoryFromEnvironment(@NotNull EnvironmentRepositoryLink environmentRepository)RemoveEnvironmentRepositoryLinkfrom environmentvoidreplaceNotification(long environmentId, long oldNotificationId, @NotNull NotificationRule newRule)Replaces notification in the environment's notification set.voidresetTriggersForDeployment(long deploymentProjectId)Delete and recreate triggers for all environments for this deploymentvoidrestartAllTriggeringForDeploymentProject(long deploymentProjectId)Restart all automatic triggering on everyEnvironmentrelated to aDeploymentProject.voidstartAllTriggers(@NotNull Environment environment)Start all automatic triggering onInternalEnvironmentvoidstartAllTriggersForDeploymentProject(long deploymentProjectId)Start all automatic triggering on everyEnvironmentrelated to aDeploymentProjectvoidstopAllTriggers(@NotNull Environment environment)Stop all automatic triggering onInternalEnvironmentvoidstopAllTriggersForDeploymentProject(long deploymentProjectId)Stop all automatic triggering on everyEnvironmentrelated to aDeploymentProjectvoidupdateEnvironmentConfigurationState(long environmentId, @NotNull ConfigurationState configurationState)Update the configurationState of this environmentvoidupdateEnvironmentPrerequisites(long environmentId, @NotNull ReleaseApprovalPrerequisite releaseApprovalPrerequisite)Updates the prerequisites of the environment with requested ID needed to launch the release.voidupdatePlanKey(long deploymentProjectId, @NotNull PlanKey originalPlanKey, @NotNull PlanKey newPlanKey)Update planKey in Environment related configuration when plan key has changed (ie after moving plan).RepositoryDefinitionupdateRepositoryLinkInEnvironment(EnvironmentRepositoryLink environmentRepositoryLink, RepositoryDataEntity newRepositoryEntity)UpdateEnvironmentRepositoryLinkdata@NotNull ErrorCollectionvalidateAddEnvironment(long deploymentProjectId, @Nullable String name, @Nullable String description)Validates values to be used for creating a new environment.@NotNull ErrorCollectionvalidateEditEnvironment(long environmentId, @Nullable String name, @Nullable String description)Validates values to be used when editing existing environment.-
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
-
Methods inherited from interface com.atlassian.bamboo.deployments.environments.service.EnvironmentService
addEnvironment
-
-
-
-
Constructor Detail
-
EnvironmentServiceImpl
public EnvironmentServiceImpl(BambooAclUpdateHelper aclUpdateHelper, HibernateMutableAclService aclService, AuditLogService auditLogService, BambooAuthenticationContext authenticationContext, DeploymentProjectDao deploymentProjectDao, EnvironmentDao environmentDao, EnvironmentRepositoryLinkDao environmentRepositoryLinkDao, PlanScheduler planScheduler, RepositoryDefinitionDao repositoryDefinitionDao, ScopedExclusionService scopedExclusionService, com.opensymphony.xwork2.TextProvider textProvider, ValidationService validationService, com.atlassian.event.api.EventPublisher eventPublisher, DeploymentVersionLinkedJiraIssueDao deploymentVersionLinkedJiraIssueDao, NotificationManager notificationManager, VariableConfigurationService variableConfigurationService, VariableDefinitionManager variableDefinitionManager, TriggerTypeManager triggerTypeManager, RepositoryDefinitionManager repositoryDefinitionManager, BambooCachingPermissionManagerFacadeFactory cachingPermissionManagerFacadeFactory, CapabilityRequirementsMatcher capabilityRequirementsMatcher, InternalEnvironmentService internalEnvironmentService)
-
-
Method Detail
-
getEnvironmentsForDeploymentProject
@NotNull public @NotNull List<Environment> getEnvironmentsForDeploymentProject(long deploymentProjectId)
Description copied from interface:EnvironmentServiceGet all environments for a particular deployment project. Does not validate deployment project actually exists.- Specified by:
getEnvironmentsForDeploymentProjectin interfaceEnvironmentService- Parameters:
deploymentProjectId- of the deployment project to get environments for- Returns:
- List of environments for a single deployment project. Sorted by position, name.
-
getPaginatedEnvironmentsForDeploymentProject
@NotNull public @NotNull PaginatedEnvironmentsForDashboard getPaginatedEnvironmentsForDeploymentProject(long deploymentProjectId, int start, int limit, @Nullable @Nullable String filter)
Description copied from interface:EnvironmentServiceGet paginated environments for a particular deployment project ordered by position. Does not validate deployment project actually exists. Filtering requires at least one character. If filter is null or empty then no filtering.- Specified by:
getPaginatedEnvironmentsForDeploymentProjectin interfaceEnvironmentService- Parameters:
deploymentProjectId- of the deployment project to get environments forstart- start by indexlimit- return no more entries than limitfilter- filter- Returns:
- List of environments for a single deployment project. Sorted by position.
- See Also:
InternalEnvironment.getPosition()
-
getEnvironmentStubsForDeploymentProject
@NotNull public @NotNull List<EnvironmentStub> getEnvironmentStubsForDeploymentProject(long deploymentProjectId)
Description copied from interface:EnvironmentServiceGet all environment stubs for a particular deployment project. Does not validate deployment project actually exists. Returns minimum data set required for rendering on deployment project pages.- Specified by:
getEnvironmentStubsForDeploymentProjectin interfaceEnvironmentService- Parameters:
deploymentProjectId- of the deployment project to get environments for- Returns:
- List of environments for a single deployment project. Sorted by position, name.
-
getEnvironmentUnrestricted
@Nullable public @Nullable Environment getEnvironmentUnrestricted(long environmentId)
Description copied from interface:EnvironmentServiceGet specific environment by ID. Does not check permissions.- Specified by:
getEnvironmentUnrestrictedin interfaceEnvironmentService- Parameters:
environmentId- ID to search for- Returns:
- environment with given ID or null if one could not be found.
-
getEnvironment
@Nullable public @Nullable Environment getEnvironment(long environmentId) throws org.acegisecurity.AccessDeniedException
Description copied from interface:EnvironmentServiceGet specific environment by ID.- Specified by:
getEnvironmentin interfaceEnvironmentService- Parameters:
environmentId- ID to search for- Returns:
- environment with given ID or null if one could not be found.
- Throws:
org.acegisecurity.AccessDeniedException- when user doesn't have permissions to view environment
-
findEnvironmentByName
@Nullable public @Nullable Environment findEnvironmentByName(long deploymentProjectId, String name)
Description copied from interface:EnvironmentServiceFind environment with specified name in a deployment project- Specified by:
findEnvironmentByNamein interfaceEnvironmentService
-
getAllEnvironments
@NotNull public @NotNull Iterable<Environment> getAllEnvironments()
Description copied from interface:EnvironmentServiceRetrieve allEnvironmentdefined in the system. The result is filtered by environment permissions and sorted by deployment project id and environment position. Environments belonging to inaccessible projects are not currently filtered out, but their operations show them to be inaccessible.- Specified by:
getAllEnvironmentsin interfaceEnvironmentService
-
getAllEnvironmentsForDashboard
@NotNull public @NotNull Collection<Environment> getAllEnvironmentsForDashboard()
Description copied from interface:EnvironmentServiceRetrieve allEnvironmentdefined in the system. The result is filtered by environment permissions and sorted by deployment project id and environment position. Environments belonging to inaccessible projects are not currently filtered out, but their operations show them to be inaccessible. Some data inside the object may be unavailable.- Specified by:
getAllEnvironmentsForDashboardin interfaceEnvironmentService
-
getAllEnvironmentsNoUserContext
@NotNull public @NotNull Iterable<Environment> getAllEnvironmentsNoUserContext()
Description copied from interface:EnvironmentServiceRetrieve allEnvironmentdefined in the system without filling in operations permitted for the user.- Specified by:
getAllEnvironmentsNoUserContextin interfaceEnvironmentService
-
getAllEnvironmentsNoUserContext
public Iterable<Environment> getAllEnvironmentsNoUserContext(int firstResult, int pageSize)
Description copied from interface:EnvironmentServiceRetrieve allEnvironmentdefined in the system without filling in operations permitted for the user.- Specified by:
getAllEnvironmentsNoUserContextin interfaceEnvironmentService
-
getAllInternalEnvironmentsNoUserContext
public Iterable<InternalEnvironment> getAllInternalEnvironmentsNoUserContext(int firstResult, int maxResults)
Description copied from interface:EnvironmentServiceRetrieve allEnvironmentdefined in the system without filling in operations permitted for the user.- Specified by:
getAllInternalEnvironmentsNoUserContextin interfaceEnvironmentService
-
countAll
public long countAll()
- Specified by:
countAllin interfaceEnvironmentService
-
createImmutableEnvironment
@NotNull public @NotNull Environment createImmutableEnvironment(@NotNull @NotNull MutableEnvironment mutableEnvironment)
Description copied from interface:EnvironmentServiceConverts mutable environment to immutable.- Specified by:
createImmutableEnvironmentin interfaceEnvironmentService
-
createOperationsAwareImmutableEnvironment
@NotNull protected @NotNull Environment createOperationsAwareImmutableEnvironment(Environment environment)
-
createOperationsAwareImmutableEnvironment
@NotNull public @NotNull Environment createOperationsAwareImmutableEnvironment(@NotNull @NotNull MutableEnvironment environment)
Description copied from interface:EnvironmentServiceCreate operation aware immutable environment- Specified by:
createOperationsAwareImmutableEnvironmentin interfaceEnvironmentService- See Also:
Operations
-
updateEnvironmentPrerequisites
public void updateEnvironmentPrerequisites(long environmentId, @NotNull @NotNull ReleaseApprovalPrerequisite releaseApprovalPrerequisite)Description copied from interface:EnvironmentServiceUpdates the prerequisites of the environment with requested ID needed to launch the release.- Specified by:
updateEnvironmentPrerequisitesin interfaceEnvironmentService- Parameters:
environmentId- id of the environmentreleaseApprovalPrerequisite- new prerequisites
-
validateAddEnvironment
@NotNull public @NotNull ErrorCollection validateAddEnvironment(long deploymentProjectId, @Nullable @Nullable String name, @Nullable @Nullable String description)
Description copied from interface:EnvironmentServiceValidates values to be used for creating a new environment.- Specified by:
validateAddEnvironmentin interfaceEnvironmentService- Returns:
- errorCollection containing any errors found. If no errors, an empty errorCollection will be returned.
-
addEnvironment
@NotNull public @NotNull Environment addEnvironment(long deploymentProjectId, @Nullable @Nullable String name, @Nullable @Nullable String description, @Nullable @Nullable ReleaseApprovalPrerequisite releaseApprovalPrerequisite) throws WebValidationException
Description copied from interface:EnvironmentServiceCreates a new environment in the specified deployment project.- Specified by:
addEnvironmentin interfaceEnvironmentService- Parameters:
deploymentProjectId- to create environment inname- of the environment.description- of the environment.releaseApprovalPrerequisite- prerequisites needed to be met before launching release is possible- Throws:
WebValidationException
-
cloneEnvironment
@NotNull public @NotNull Environment cloneEnvironment(long deploymentProjectId, long environmentId, @Nullable @Nullable String name, @Nullable @Nullable String description) throws WebValidationException
Description copied from interface:EnvironmentServiceCreate new environment as a clone of existing one- Specified by:
cloneEnvironmentin interfaceEnvironmentService- Returns:
- Throws:
WebValidationException- when user has no permission to clone environment with dedicated agents or deployment/environment not found
-
cloneEnvironment
@NotNull public @NotNull Environment cloneEnvironment(long deploymentProjectId, long environmentId, @Nullable @Nullable String name, @Nullable @Nullable String description, @NotNull @NotNull Map<String,String> oldAndClonedEnvironmentIds) throws WebValidationException
Description copied from interface:EnvironmentServiceCreate new environment as a clone of existing one and if necessary update triggers' configuration- Specified by:
cloneEnvironmentin interfaceEnvironmentService- Returns:
- Throws:
WebValidationException- when user has no permission to clone environment with dedicated agents or deployment/environment not found
-
validateEditEnvironment
@NotNull public @NotNull ErrorCollection validateEditEnvironment(long environmentId, @Nullable @Nullable String name, @Nullable @Nullable String description)
Description copied from interface:EnvironmentServiceValidates values to be used when editing existing environment.- Specified by:
validateEditEnvironmentin interfaceEnvironmentService- Parameters:
environmentId- environment to editname- of the environmentdescription- of the environment- Returns:
- errorCollection containing any errors found. If no errors, an empty errorCollection will be returned.
-
editEnvironment
@NotNull public @NotNull Environment editEnvironment(long environmentId, String name, String description) throws WebValidationException
Description copied from interface:EnvironmentServiceEdit the details of an existing environment- Specified by:
editEnvironmentin interfaceEnvironmentService- Parameters:
environmentId- environment to editname- of the environmentdescription- of the environment- Returns:
- the updated environment
- Throws:
WebValidationException
-
editEnvironment
@NotNull public @NotNull Environment editEnvironment(long environmentId, String name, String description, @Nullable @Nullable ReleaseApprovalPrerequisite releaseApprovalPrerequisite) throws WebValidationException
Description copied from interface:EnvironmentServiceEdit the details of an existing environment- Specified by:
editEnvironmentin interfaceEnvironmentService- Parameters:
environmentId- environment to editname- of the environmentdescription- of the environmentreleaseApprovalPrerequisite- prerequisites needed to be met before launching release is possible- Returns:
- the updated environment
- Throws:
WebValidationException
-
updateEnvironmentConfigurationState
public void updateEnvironmentConfigurationState(long environmentId, @NotNull @NotNull ConfigurationState configurationState)Description copied from interface:EnvironmentServiceUpdate the configurationState of this environment- Specified by:
updateEnvironmentConfigurationStatein interfaceEnvironmentService- Parameters:
environmentId- of environment to updateconfigurationState- new configuration state
-
getEnvironmentRequirementSet
@Nullable public @Nullable RequirementSet getEnvironmentRequirementSet(long environmentId)
Description copied from interface:EnvironmentServiceRetrieve Agent Requirement set for environment, if environment with id exists.- Specified by:
getEnvironmentRequirementSetin interfaceEnvironmentService- Parameters:
environmentId- of environment- Returns:
- all requirements this environment has.
-
getRepositoryDefinitionsForEnvironment
@NotNull public @NotNull List<RepositoryDefinition> getRepositoryDefinitionsForEnvironment(@NotNull @NotNull Environment environment)
Description copied from interface:EnvironmentServiceRetrieves all repositories used in environment source checkout tasks- Specified by:
getRepositoryDefinitionsForEnvironmentin interfaceEnvironmentService- Returns:
-
getPlanRepositoryDefinitionsForEnvironment
@NotNull public @NotNull List<PlanRepositoryDefinition> getPlanRepositoryDefinitionsForEnvironment(@NotNull @NotNull Environment environment)
Description copied from interface:EnvironmentServiceRetrieves all repositories used in environment source checkout tasks- Specified by:
getPlanRepositoryDefinitionsForEnvironmentin interfaceEnvironmentService- Returns:
-
getPlanRepositoryDefinitionsForEnvironment
@NotNull public @NotNull List<PlanRepositoryDefinition> getPlanRepositoryDefinitionsForEnvironment(@NotNull @NotNull InternalEnvironment environment)
Description copied from interface:EnvironmentServiceRetrieves all repositories used in environment source checkout tasks- Specified by:
getPlanRepositoryDefinitionsForEnvironmentin interfaceEnvironmentService- Returns:
-
getEnvironmentsUsingRepository
public List<EnvironmentRepositoryLink> getEnvironmentsUsingRepository(long repositoryId)
- Specified by:
getEnvironmentsUsingRepositoryin interfaceEnvironmentService
-
getEnvironmentRepositoryLinksForRepository
public List<EnvironmentRepositoryLink> getEnvironmentRepositoryLinksForRepository(long repositoryId)
- Specified by:
getEnvironmentRepositoryLinksForRepositoryin interfaceEnvironmentService- Parameters:
repositoryId- repository id- Returns:
- list of Source Repository relationships defined for the given repository
-
getEnvironmentsUsingRepositoryDataEntity
public List<Environment> getEnvironmentsUsingRepositoryDataEntity(long repositoryId)
Description copied from interface:EnvironmentServiceTODO 6.0 rename to getEnvironmentsUsingRepository- Specified by:
getEnvironmentsUsingRepositoryDataEntityin interfaceEnvironmentService- Parameters:
repositoryId- repository id- Returns:
- list of immutable
Environments that use given repository
-
removeRepositoryFromEnvironment
public void removeRepositoryFromEnvironment(@NotNull @NotNull EnvironmentRepositoryLink environmentRepository)Description copied from interface:EnvironmentServiceRemoveEnvironmentRepositoryLinkfrom environment- Specified by:
removeRepositoryFromEnvironmentin interfaceEnvironmentService
-
updateRepositoryLinkInEnvironment
public RepositoryDefinition updateRepositoryLinkInEnvironment(EnvironmentRepositoryLink environmentRepositoryLink, RepositoryDataEntity newRepositoryEntity)
Description copied from interface:EnvironmentServiceUpdateEnvironmentRepositoryLinkdata- Specified by:
updateRepositoryLinkInEnvironmentin interfaceEnvironmentService- Returns:
-
addNotification
public void addNotification(long environmentId, @NotNull @NotNull NotificationRule newRule) throws WebValidationExceptionDescription copied from interface:EnvironmentServiceAdds a new notification to the environment notifications- Specified by:
addNotificationin interfaceEnvironmentService- Throws:
WebValidationException
-
getNotificationSet
public NotificationSet getNotificationSet(long environmentId)
Description copied from interface:EnvironmentServiceRetrieve notification set for environment, if environment with id exists.- Specified by:
getNotificationSetin interfaceEnvironmentService- Parameters:
environmentId- of environment
-
deleteNotification
public void deleteNotification(long environmentId, long notificationId) throws WebValidationExceptionDescription copied from interface:EnvironmentServiceRemoves notification from the environment's notification set.- Specified by:
deleteNotificationin interfaceEnvironmentService- Throws:
WebValidationException
-
replaceNotification
public void replaceNotification(long environmentId, long oldNotificationId, @NotNull @NotNull NotificationRule newRule) throws WebValidationExceptionDescription copied from interface:EnvironmentServiceReplaces notification in the environment's notification set.- Specified by:
replaceNotificationin interfaceEnvironmentService- Throws:
WebValidationException
-
stopAllTriggers
public void stopAllTriggers(@NotNull @NotNull Environment environment)Description copied from interface:EnvironmentServiceStop all automatic triggering onInternalEnvironment- Specified by:
stopAllTriggersin interfaceEnvironmentService
-
startAllTriggers
public void startAllTriggers(@NotNull @NotNull Environment environment)Description copied from interface:EnvironmentServiceStart all automatic triggering onInternalEnvironment- Specified by:
startAllTriggersin interfaceEnvironmentService
-
stopAllTriggersForDeploymentProject
public void stopAllTriggersForDeploymentProject(long deploymentProjectId)
Description copied from interface:EnvironmentServiceStop all automatic triggering on everyEnvironmentrelated to aDeploymentProject- Specified by:
stopAllTriggersForDeploymentProjectin interfaceEnvironmentService
-
startAllTriggersForDeploymentProject
public void startAllTriggersForDeploymentProject(long deploymentProjectId)
Description copied from interface:EnvironmentServiceStart all automatic triggering on everyEnvironmentrelated to aDeploymentProject- Specified by:
startAllTriggersForDeploymentProjectin interfaceEnvironmentService
-
restartAllTriggeringForDeploymentProject
public void restartAllTriggeringForDeploymentProject(long deploymentProjectId)
Description copied from interface:EnvironmentServiceRestart all automatic triggering on everyEnvironmentrelated to aDeploymentProject. When using this method please keep in mind that triggers should be stopped before modifying their configuration and restarted afterwards. ThusEnvironmentService.stopAllTriggersForDeploymentProject(long)andEnvironmentService.startAllTriggersForDeploymentProject(long)might be more useful.- Specified by:
restartAllTriggeringForDeploymentProjectin interfaceEnvironmentService
-
moveEnvironmentUp
@NotNull public @NotNull ErrorCollection moveEnvironmentUp(long deploymentProjectId, long environmentId, int currentPosition)
Description copied from interface:EnvironmentServiceMoves an environment up the list- Specified by:
moveEnvironmentUpin interfaceEnvironmentService
-
moveEnvironmentDown
@NotNull public @NotNull ErrorCollection moveEnvironmentDown(long deploymentProjectId, long environmentId, int currentPosition)
Description copied from interface:EnvironmentServiceMoves an environment down the list- Specified by:
moveEnvironmentDownin interfaceEnvironmentService
-
moveEnvironment
public ErrorCollection moveEnvironment(MoveEnvironmentStrategy moveEnvironmentStrategy, long deploymentProjectId, long environmentId, int currentPosition, Optional<Long> relatedEnvId)
Description copied from interface:EnvironmentServiceMove Environment in given deploymentProject with given strategy. relatedEnvId is optional for most cases. It is only required for strategyMoveEnvironmentStrategy.AFTERorMoveEnvironmentStrategy.BEFORE- Specified by:
moveEnvironmentin interfaceEnvironmentService- Returns:
- error collection
-
getEnvironmentCount
public int getEnvironmentCount()
- Specified by:
getEnvironmentCountin interfaceEnvironmentService- Returns:
- number of all environments
-
getEnvironmentCountForProject
public int getEnvironmentCountForProject(DeploymentProject deploymentProject)
- Specified by:
getEnvironmentCountForProjectin interfaceEnvironmentService- Returns:
- number of environments defined for project
-
updatePlanKey
public void updatePlanKey(long deploymentProjectId, @NotNull @NotNull PlanKey originalPlanKey, @NotNull @NotNull PlanKey newPlanKey)Description copied from interface:EnvironmentServiceUpdate planKey in Environment related configuration when plan key has changed (ie after moving plan). This method is called byDeploymentProjectService.updatePlanKey(PlanKey, PlanKey)after DeploymentProject has been updated.- Specified by:
updatePlanKeyin interfaceEnvironmentService- Parameters:
deploymentProjectId- id of deployment project which environments have to be checkedoriginalPlanKey- original PlanKeynewPlanKey- new PlanKey
-
getEnvironmentsMatchingCapabilities
@NotNull public @NotNull PaginatedEnvironmentsForExecutablesView getEnvironmentsMatchingCapabilities(int start, int limit, @Nullable @Nullable String filter, @NotNull @NotNull ReadOnlyCapabilitySet agentCapabilities)
Description copied from interface:EnvironmentServiceProvide a paginated list of minimal information about deployment environments matching agent capabilities.- Specified by:
getEnvironmentsMatchingCapabilitiesin interfaceEnvironmentService- Parameters:
start- start by indexlimit- return no more entries than limitfilter- filteragentCapabilities- capabilities of an agent- Returns:
- List of ids and name of deployment projects and environments, sorted alphabetically by deployment name and environment position;
-
getEnvironmentsMatchingCapabilities
@NotNull public @NotNull PaginatedEnvironmentsForExecutablesView getEnvironmentsMatchingCapabilities(int start, int limit, @Nullable @Nullable String filter, @NotNull @NotNull ReadOnlyCapabilitySet agentCapabilities, @NotNull @NotNull Iterable<AgentAssignmentService.AgentAssignmentExecutor> executors)
Description copied from interface:EnvironmentServiceProvide a paginated list of minimal information about deployment environments matching agent capabilities.- Specified by:
getEnvironmentsMatchingCapabilitiesin interfaceEnvironmentService- Parameters:
start- start by indexlimit- return no more entries than limitfilter- filteragentCapabilities- capabilities of an agentexecutors- executors of agent assignment- Returns:
- List of ids and name of deployment projects and environments, sorted alphabetically by deployment name and environment position;
-
resetTriggersForDeployment
public void resetTriggersForDeployment(long deploymentProjectId)
Description copied from interface:EnvironmentServiceDelete and recreate triggers for all environments for this deployment- Specified by:
resetTriggersForDeploymentin interfaceEnvironmentService
-
getEnvironmentDecorator
public Function<Environment,DecoratedEnvironment> getEnvironmentDecorator()
Description copied from interface:EnvironmentServiceCreate 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.- Specified by:
getEnvironmentDecoratorin interfaceEnvironmentService
-
findEnvironmentsByRequirementKey
@NotNull public @NotNull Set<RequirementDeploymentMapping> findEnvironmentsByRequirementKey(@NotNull @NotNull String requirementKey)
Description copied from interface:EnvironmentServiceFind environments which rely on requirementKey- Specified by:
findEnvironmentsByRequirementKeyin interfaceEnvironmentService- Parameters:
requirementKey- on which environments rely- Returns:
- environments or empty set
-
-