com.atlassian.bamboo.deployments.environments.service
Interface EnvironmentService

All Known Implementing Classes:
EnvironmentServiceImpl

public interface EnvironmentService

Provides services and functionality around Environments. All objects returned/inputted are immutable.


Field Summary
static java.lang.String DEFAULT_ARTIFACT_TASK_NAME
           
 
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 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.
 

Field Detail

DEFAULT_ARTIFACT_TASK_NAME

static final java.lang.String DEFAULT_ARTIFACT_TASK_NAME
See Also:
Constant Field Values
Method Detail

getEnvironmentsForDeploymentProject

@NotNull
java.util.List<Environment> getEnvironmentsForDeploymentProject(long deploymentProjectId)
Get all environments for a particular deployment project. Does not validate deployment project actually exists.

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

getEnvironment

@Nullable
Environment getEnvironment(long environmentId)
Get specific environment by ID.

Parameters:
environmentId - ID to search for
Returns:
environment with given ID or null if one could not be found.

validateAddEnvironment

@NotNull
ErrorCollection validateAddEnvironment(long deploymentProjectId,
                                               @Nullable
                                               java.lang.String name,
                                               @Nullable
                                               java.lang.String description)
Validates values to be used for creating a new environment.

Parameters:
deploymentProjectId -
name -
description -
Returns:
errorCollection containing any errors found. If no errors, an empty errorCollection will be returned.

addEnvironment

@NotNull
Environment addEnvironment(long deploymentProjectId,
                                   @Nullable
                                   java.lang.String name,
                                   @Nullable
                                   java.lang.String description)
                           throws WebValidationException
Creates a new environment in the specified deployment project.

Parameters:
deploymentProjectId - to create environment in
name - of the environment.
description - of the environment.
Throws:
WebValidationException

validateEditEnvironment

@NotNull
ErrorCollection validateEditEnvironment(long environmentId,
                                                @Nullable
                                                java.lang.String name,
                                                @Nullable
                                                java.lang.String description)
Validates values to be used when editing existing environment.

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
Environment editEnvironment(long environmentId,
                                    java.lang.String name,
                                    java.lang.String description)
                            throws WebValidationException
Edit the details of an existing environment

Parameters:
environmentId - environment to edit
name - of the environment
description - of the environment
Returns:
the updated environment
Throws:
WebValidationException

updateEnvironmentConfigurationState

void updateEnvironmentConfigurationState(long environmentId,
                                         @NotNull
                                         ConfigurationState configurationState)
Update the configurationState of this environment

Parameters:
environmentId - of environment to update
configurationState - new configuration state

getEnvironmentRequirementSet

@Nullable
RequirementSet getEnvironmentRequirementSet(long environmentId)
Retrieve Agent Requirement set for environment, if environment with id exists.

Parameters:
environmentId - of environment
Returns:
all requirements this environment has.

getAllEnvironments

@NotNull
java.lang.Iterable<Environment> getAllEnvironments()
Retrieve all Environment defined in the system.


getRepositoryDefinitionsForEnvironment

@NotNull
java.util.List<RepositoryDefinition> getRepositoryDefinitionsForEnvironment(@NotNull
                                                                                    Environment environment)
Retrieves all repositories used in environment source checkout tasks

Parameters:
environment -
Returns:

getEnvironmentsUsingRepository

java.util.List<EnvironmentRepositoryLink> getEnvironmentsUsingRepository(long repositoryId)
Retrieves

Parameters:
repositoryId -
Returns:

updateRepositoryLinkInEnvironment

RepositoryDefinition updateRepositoryLinkInEnvironment(EnvironmentRepositoryLink environmentRepositoryLink,
                                                       RepositoryDataEntity newRepositoryEntity)
Update EnvironmentRepositoryLink data

Parameters:
environmentRepositoryLink -
newRepositoryEntity -
Returns:

addNotification

void addNotification(long environmentId,
                     @NotNull
                     NotificationRule newRule)
                     throws WebValidationException
Adds a new notification to the environment notifications

Throws:
WebValidationException

getNotificationSet

@Nullable
NotificationSet getNotificationSet(long environmentId)
Retrieve notification set for environment, if environment with id exists.

Parameters:
environmentId - of environment

deleteNotification

void deleteNotification(long environmentId,
                        long notificationId)
                        throws WebValidationException
Removes notification from the environment's notification set.

Throws:
WebValidationException

stopAllTriggers

void stopAllTriggers(@NotNull
                     InternalEnvironment environment)
Stop all automatic triggering on InternalEnvironment

Parameters:
environment -

stopAllTriggersForDeploymentProject

void stopAllTriggersForDeploymentProject(long deploymentProjectId)
Stop all automatic triggering on every Environment related to a DeploymentProject

Parameters:
deploymentProjectId -

restartAllTriggeringForDeploymentProject

void restartAllTriggeringForDeploymentProject(long deploymentProjectId)
Restart all automatic triggering on every Environment related to a DeploymentProject


moveEnvironmentUp

@NotNull
ErrorCollection moveEnvironmentUp(long deploymentProjectId,
                                          long environmentId,
                                          int currentPosition)
Moves an environment up the list


moveEnvironmentDown

@NotNull
ErrorCollection moveEnvironmentDown(long deploymentProjectId,
                                            long environmentId,
                                            int currentPosition)
Moves an environment down the list



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