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

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

public class EnvironmentTriggerServiceImpl
extends Object
implements EnvironmentTriggerService


Constructor Summary
EnvironmentTriggerServiceImpl(BuildStrategyManager buildStrategyManager, DeploymentProjectService deploymentProjectService, EnvironmentDao environmentDao, PlanScheduler planScheduler, ScopedExclusionService scopedExclusionService, com.opensymphony.xwork2.TextProvider textProvider, TriggerTypeManager triggerTypeManager)
           
 
Method Summary
 BuildStrategy createEnvironmentTrigger(long environmentId, String userDescription, Set<Long> triggeringRepositories, org.apache.commons.configuration.HierarchicalConfiguration configuration)
          Creates a BuildStrategy and saves it in Environment configuration.
 TriggerDefinition createEnvironmentTrigger(long environmentId, TriggerModuleDescriptor triggerModuleDescriptor, String userDescription, boolean isEnabled, Map<String,String> configuration)
          Create a trigger Definition and save it against the plan
 void deleteEnvironmentTrigger(long environmentId, long triggerId)
          Delete a given trigger Definition
 TriggerDefinition editEnvironmentTrigger(long environmentId, long triggerId, String userDescription, boolean isEnabled, Map<String,String> triggerConfigurationMap)
          Update the details of specific triggerDefinition
 PlanKey getCalculatedTriggeringPlanKey(InternalEnvironment environment, DeploymentTriggerBranchSelectionMode branchSelectionMode, PlanKey customBranchKey)
           
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

EnvironmentTriggerServiceImpl

public EnvironmentTriggerServiceImpl(BuildStrategyManager buildStrategyManager,
                                     DeploymentProjectService deploymentProjectService,
                                     EnvironmentDao environmentDao,
                                     PlanScheduler planScheduler,
                                     ScopedExclusionService scopedExclusionService,
                                     com.opensymphony.xwork2.TextProvider textProvider,
                                     TriggerTypeManager triggerTypeManager)
Method Detail

createEnvironmentTrigger

public TriggerDefinition createEnvironmentTrigger(long environmentId,
                                                  @NotNull
                                                  TriggerModuleDescriptor triggerModuleDescriptor,
                                                  @Nullable
                                                  String userDescription,
                                                  boolean isEnabled,
                                                  @NotNull
                                                  Map<String,String> configuration)
                                           throws IllegalArgumentException
Description copied from interface: EnvironmentTriggerService
Create a trigger Definition and save it against the plan

Specified by:
createEnvironmentTrigger in interface EnvironmentTriggerService
Parameters:
environmentId - id of an environment the triggerDefinition belongs to
triggerModuleDescriptor - for the TriggerDefinition to be added
userDescription - description the user has specified for this TriggerDefinition
isEnabled - set enabled/disabled state of the newly created trigger
configuration - configuration from the plugin for this TriggerDefinition
Returns:
the TriggerDefinition created
Throws:
IllegalArgumentException - if environmentId is invalid

editEnvironmentTrigger

public TriggerDefinition editEnvironmentTrigger(long environmentId,
                                                long triggerId,
                                                @Nullable
                                                String userDescription,
                                                boolean isEnabled,
                                                @NotNull
                                                Map<String,String> triggerConfigurationMap)
                                         throws IllegalArgumentException
Description copied from interface: EnvironmentTriggerService
Update the details of specific triggerDefinition

Specified by:
editEnvironmentTrigger in interface EnvironmentTriggerService
Parameters:
environmentId - id of an environment the triggerDefinition belongs to
triggerId - the TriggerDefinition to edit
userDescription - new user description
isEnabled - set new enabled/disabled state
triggerConfigurationMap - new task Configuration
Returns:
TriggerDefinition with updates.
Throws:
IllegalArgumentException - if environmentId or triggerId is invalid.

deleteEnvironmentTrigger

public void deleteEnvironmentTrigger(long environmentId,
                                     long triggerId)
                              throws IllegalArgumentException,
                                     IllegalStateException
Description copied from interface: EnvironmentTriggerService
Delete a given trigger Definition

Specified by:
deleteEnvironmentTrigger in interface EnvironmentTriggerService
Parameters:
environmentId - id of an environment the triggerDefinition belongs to
triggerId - of the TriggerDefinition to delete.
Throws:
IllegalArgumentException - if environmentId is invalid
IllegalStateException - if the task list has changed since submitting request, i.e the task isn't there to delete anymore.

getCalculatedTriggeringPlanKey

@NotNull
public PlanKey getCalculatedTriggeringPlanKey(@NotNull
                                                      InternalEnvironment environment,
                                                      @NotNull
                                                      DeploymentTriggerBranchSelectionMode branchSelectionMode,
                                                      @Nullable
                                                      PlanKey customBranchKey)
                                       throws DeploymentException
Specified by:
getCalculatedTriggeringPlanKey in interface EnvironmentTriggerService
Throws:
DeploymentException

createEnvironmentTrigger

public BuildStrategy createEnvironmentTrigger(long environmentId,
                                              @NotNull
                                              String userDescription,
                                              @NotNull
                                              Set<Long> triggeringRepositories,
                                              @NotNull
                                              org.apache.commons.configuration.HierarchicalConfiguration configuration)
                                       throws IllegalArgumentException
Description copied from interface: EnvironmentTriggerService
Creates a BuildStrategy and saves it in Environment configuration.

Specified by:
createEnvironmentTrigger in interface EnvironmentTriggerService
Throws:
IllegalArgumentException - if environmentId is invalid


Copyright © 2015 Atlassian Software Systems Pty Ltd. All rights reserved.