com.atlassian.bamboo.deployments.environments.service
Class EnvironmentServiceImpl

java.lang.Object
  extended by com.atlassian.bamboo.deployments.environments.service.EnvironmentServiceImpl
All Implemented Interfaces:
EnvironmentService

public class EnvironmentServiceImpl
extends java.lang.Object
implements EnvironmentService


Field Summary
 
Fields inherited from interface com.atlassian.bamboo.deployments.environments.service.EnvironmentService
DEFAULT_ARTIFACT_TASK_NAME
 
Constructor Summary
EnvironmentServiceImpl(DeploymentProjectDao deploymentProjectDao, EnvironmentDao environmentDao, AuditLogService auditLogService, com.opensymphony.xwork.TextProvider textProvider, ValidationService validationService, PlanScheduler planScheduler, BambooAclUpdateHelper aclUpdateHelper, BambooAuthenticationContext authenticationContext, HibernateMutableAclService aclService, BambooPermissionManager bambooPermissionManager, RepositoryDefinitionDao repositoryDefinitionDao, EnvironmentRepositoryLinkDao environmentRepositoryLinkDao, DeploymentResultDeletionService deploymentResultDeletionService, BambooTransactionHibernateTemplate bambooTransactionHibernateTemplate, VariableDefinitionDao variableDefinitionDao, ScopedExclusionService scopedExclusionService)
           
 
Method Summary
 Environment addEnvironment(long deploymentProjectId, java.lang.String name, java.lang.String description)
          Creates a new environment in the specified deployment project.
 void addNotification(long environmentId, NotificationRule newRule)
          Adds a new notification to the environment notifications
 void deleteNotification(long environmentId, long notificationId)
          Removes notification from the environment's notification set.
 Environment editEnvironment(long environmentId, java.lang.String name, java.lang.String description)
          Edit the details of an existing environment
 java.lang.Iterable<Environment> getAllEnvironments()
          Retrieve all Environment defined in the system.
 Environment getEnvironment(long environmentId)
          Get specific environment by ID.
 RequirementSet getEnvironmentRequirementSet(long environmentId)
          Retrieve Agent Requirement set for environment, if environment with id exists.
 java.util.List<Environment> getEnvironmentsForDeploymentProject(long deploymentProjectId)
          Get all environments for a particular deployment project.
 java.util.List<EnvironmentRepositoryLink> getEnvironmentsUsingRepository(long repositoryId)
          Retrieves
 NotificationSet getNotificationSet(long environmentId)
          Retrieve notification set for environment, if environment with id exists.
 java.util.List<RepositoryDefinition> getRepositoryDefinitionsForEnvironment(Environment environment)
          Retrieves all repositories used in environment source checkout tasks
 ErrorCollection moveEnvironmentDown(long deploymentProjectId, long environmentId, int currentPosition)
          Moves an environment down the list
 ErrorCollection moveEnvironmentUp(long deploymentProjectId, long environmentId, int currentPosition)
          Moves an environment up the list
 void restartAllTriggeringForDeploymentProject(long deploymentProjectId)
          Restart all automatic triggering on every Environment related to a DeploymentProject
 void startAllTriggers(InternalEnvironment environment)
           
 void stopAllTriggers(InternalEnvironment environment)
          Stop all automatic triggering on InternalEnvironment
 void stopAllTriggersForDeploymentProject(long deploymentProjectId)
          Stop all automatic triggering on every Environment related to a DeploymentProject
 void updateEnvironmentConfigurationState(long environmentId, ConfigurationState configurationState)
          Update the configurationState of this environment
 RepositoryDefinition updateRepositoryLinkInEnvironment(EnvironmentRepositoryLink environmentRepositoryLink, RepositoryDataEntity newRepositoryEntity)
          Update EnvironmentRepositoryLink data
 ErrorCollection validateAddEnvironment(long deploymentProjectId, java.lang.String name, java.lang.String description)
          Validates values to be used for creating a new environment.
 ErrorCollection validateEditEnvironment(long environmentId, java.lang.String name, java.lang.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
 

Constructor Detail

EnvironmentServiceImpl

public EnvironmentServiceImpl(DeploymentProjectDao deploymentProjectDao,
                              EnvironmentDao environmentDao,
                              AuditLogService auditLogService,
                              com.opensymphony.xwork.TextProvider textProvider,
                              ValidationService validationService,
                              PlanScheduler planScheduler,
                              BambooAclUpdateHelper aclUpdateHelper,
                              BambooAuthenticationContext authenticationContext,
                              HibernateMutableAclService aclService,
                              BambooPermissionManager bambooPermissionManager,
                              RepositoryDefinitionDao repositoryDefinitionDao,
                              EnvironmentRepositoryLinkDao environmentRepositoryLinkDao,
                              DeploymentResultDeletionService deploymentResultDeletionService,
                              BambooTransactionHibernateTemplate bambooTransactionHibernateTemplate,
                              VariableDefinitionDao variableDefinitionDao,
                              ScopedExclusionService scopedExclusionService)
Method Detail

getEnvironmentsForDeploymentProject

@NotNull
public java.util.List<Environment> getEnvironmentsForDeploymentProject(long deploymentProjectId)
Description copied from interface: EnvironmentService
Get all environments for a particular deployment project. Does not validate deployment project actually exists.

Specified by:
getEnvironmentsForDeploymentProject in interface EnvironmentService
Parameters:
deploymentProjectId - of the deployment project to get environments for
Returns:
List of environments for a single deployment project. Sorted by name.

getEnvironment

@Nullable
public Environment getEnvironment(long environmentId)
Description copied from interface: EnvironmentService
Get specific environment by ID.

Specified by:
getEnvironment in interface EnvironmentService
Parameters:
environmentId - ID to search for
Returns:
environment with given ID or null if one could not be found.

getAllEnvironments

@NotNull
public java.lang.Iterable<Environment> getAllEnvironments()
Description copied from interface: EnvironmentService
Retrieve all Environment defined in the system.

Specified by:
getAllEnvironments in interface EnvironmentService

validateAddEnvironment

@NotNull
public ErrorCollection validateAddEnvironment(long deploymentProjectId,
                                                      @Nullable
                                                      java.lang.String name,
                                                      @Nullable
                                                      java.lang.String description)
Description copied from interface: EnvironmentService
Validates values to be used for creating a new environment.

Specified by:
validateAddEnvironment in interface EnvironmentService
Returns:
errorCollection containing any errors found. If no errors, an empty errorCollection will be returned.

addEnvironment

@NotNull
public Environment addEnvironment(long deploymentProjectId,
                                          @Nullable
                                          java.lang.String name,
                                          @Nullable
                                          java.lang.String description)
                           throws WebValidationException
Description copied from interface: EnvironmentService
Creates a new environment in the specified deployment project.

Specified by:
addEnvironment in interface EnvironmentService
Parameters:
deploymentProjectId - to create environment in
name - of the environment.
description - of the environment.
Throws:
WebValidationException

validateEditEnvironment

@NotNull
public ErrorCollection validateEditEnvironment(long environmentId,
                                                       @Nullable
                                                       java.lang.String name,
                                                       @Nullable
                                                       java.lang.String description)
Description copied from interface: EnvironmentService
Validates values to be used when editing existing environment.

Specified by:
validateEditEnvironment in interface EnvironmentService
Parameters:
environmentId - environment to edit
name - of the environment
description - of the environment
Returns:
errorCollection containing any errors found. If no errors, an empty errorCollection will be returned.

editEnvironment

@NotNull
public Environment editEnvironment(long environmentId,
                                           java.lang.String name,
                                           java.lang.String description)
                            throws WebValidationException
Description copied from interface: EnvironmentService
Edit the details of an existing environment

Specified by:
editEnvironment in interface EnvironmentService
Parameters:
environmentId - environment to edit
name - of the environment
description - of the environment
Returns:
the updated environment
Throws:
WebValidationException

updateEnvironmentConfigurationState

public void updateEnvironmentConfigurationState(long environmentId,
                                                @NotNull
                                                ConfigurationState configurationState)
Description copied from interface: EnvironmentService
Update the configurationState of this environment

Specified by:
updateEnvironmentConfigurationState in interface EnvironmentService
Parameters:
environmentId - of environment to update
configurationState - new configuration state

getEnvironmentRequirementSet

@Nullable
public RequirementSet getEnvironmentRequirementSet(long environmentId)
Description copied from interface: EnvironmentService
Retrieve Agent Requirement set for environment, if environment with id exists.

Specified by:
getEnvironmentRequirementSet in interface EnvironmentService
Parameters:
environmentId - of environment
Returns:
all requirements this environment has.

getRepositoryDefinitionsForEnvironment

@NotNull
public java.util.List<RepositoryDefinition> getRepositoryDefinitionsForEnvironment(@NotNull
                                                                                           Environment environment)
Description copied from interface: EnvironmentService
Retrieves all repositories used in environment source checkout tasks

Specified by:
getRepositoryDefinitionsForEnvironment in interface EnvironmentService
Returns:

getEnvironmentsUsingRepository

public java.util.List<EnvironmentRepositoryLink> getEnvironmentsUsingRepository(long repositoryId)
Description copied from interface: EnvironmentService
Retrieves

Specified by:
getEnvironmentsUsingRepository in interface EnvironmentService
Returns:

updateRepositoryLinkInEnvironment

public RepositoryDefinition updateRepositoryLinkInEnvironment(EnvironmentRepositoryLink environmentRepositoryLink,
                                                              RepositoryDataEntity newRepositoryEntity)
Description copied from interface: EnvironmentService
Update EnvironmentRepositoryLink data

Specified by:
updateRepositoryLinkInEnvironment in interface EnvironmentService
Returns:

addNotification

public void addNotification(long environmentId,
                            @NotNull
                            NotificationRule newRule)
                     throws WebValidationException
Description copied from interface: EnvironmentService
Adds a new notification to the environment notifications

Specified by:
addNotification in interface EnvironmentService
Throws:
WebValidationException

getNotificationSet

public NotificationSet getNotificationSet(long environmentId)
Description copied from interface: EnvironmentService
Retrieve notification set for environment, if environment with id exists.

Specified by:
getNotificationSet in interface EnvironmentService
Parameters:
environmentId - of environment

deleteNotification

public void deleteNotification(long environmentId,
                               long notificationId)
                        throws WebValidationException
Description copied from interface: EnvironmentService
Removes notification from the environment's notification set.

Specified by:
deleteNotification in interface EnvironmentService
Throws:
WebValidationException

stopAllTriggers

public void stopAllTriggers(@NotNull
                            InternalEnvironment environment)
Description copied from interface: EnvironmentService
Stop all automatic triggering on InternalEnvironment

Specified by:
stopAllTriggers in interface EnvironmentService

startAllTriggers

public void startAllTriggers(@NotNull
                             InternalEnvironment environment)

stopAllTriggersForDeploymentProject

public void stopAllTriggersForDeploymentProject(long deploymentProjectId)
Description copied from interface: EnvironmentService
Stop all automatic triggering on every Environment related to a DeploymentProject

Specified by:
stopAllTriggersForDeploymentProject in interface EnvironmentService

restartAllTriggeringForDeploymentProject

public void restartAllTriggeringForDeploymentProject(long deploymentProjectId)
Description copied from interface: EnvironmentService
Restart all automatic triggering on every Environment related to a DeploymentProject

Specified by:
restartAllTriggeringForDeploymentProject in interface EnvironmentService

moveEnvironmentUp

public ErrorCollection moveEnvironmentUp(long deploymentProjectId,
                                         long environmentId,
                                         int currentPosition)
Description copied from interface: EnvironmentService
Moves an environment up the list

Specified by:
moveEnvironmentUp in interface EnvironmentService

moveEnvironmentDown

public ErrorCollection moveEnvironmentDown(long deploymentProjectId,
                                           long environmentId,
                                           int currentPosition)
Description copied from interface: EnvironmentService
Moves an environment down the list

Specified by:
moveEnvironmentDown in interface EnvironmentService


Copyright © 2013 Atlassian Software Systems Pty Ltd. All Rights Reserved.