Class RemoteTriggerDefinitionExporter
java.lang.Object
com.atlassian.bamboo.trigger.exporters.RemoteTriggerDefinitionExporter
- All Implemented Interfaces:
TriggerDefinitionExporter
-
Constructor Summary
-
Method Summary
Modifier and TypeMethodDescription@Nullable com.atlassian.bamboo.specs.builders.trigger.RemoteTrigger
fromYaml
(@NotNull Node node, @NotNull TaskValidationContext context) Parse YAML node to Trigger Specs builder.@NotNull com.atlassian.bamboo.specs.builders.trigger.RemoteTrigger
toSpecsEntity
(@NotNull TriggerDefinition triggerDefinition) This method receives andTriggerDefinition
.toTriggerConfiguration
(@NotNull com.atlassian.bamboo.specs.api.model.trigger.TriggerProperties triggerProperties, @NotNull Triggerable triggerable) Returns custom trigger configuration.<T extends com.atlassian.bamboo.specs.api.model.trigger.TriggerProperties>
@Nullable NodetoYaml
(T triggerProperties) Convert trigger definition to YAML node.List<com.atlassian.bamboo.specs.api.validators.common.ValidationProblem>
validate
(@NotNull TriggerValidationContext triggerValidationContext, @NotNull com.atlassian.bamboo.specs.api.model.trigger.TriggerProperties triggerProperties) Validates trigger properties in context of enclosing plan or deployment properties.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.trigger.export.TriggerDefinitionExporter
toSpecsEntity
-
Constructor Details
-
RemoteTriggerDefinitionExporter
public RemoteTriggerDefinitionExporter()
-
-
Method Details
-
toTriggerConfiguration
@NotNull public @NotNull Map<String,String> toTriggerConfiguration(@NotNull @NotNull com.atlassian.bamboo.specs.api.model.trigger.TriggerProperties triggerProperties, @NotNull @NotNull Triggerable triggerable) Returns custom trigger configuration. AllTriggerProperties
properties andRepositoryBasedTriggerProperties
properties are handled by "the framework".- Specified by:
toTriggerConfiguration
in interfaceTriggerDefinitionExporter
- Returns:
- trigger configuration
-
toSpecsEntity
@NotNull public @NotNull com.atlassian.bamboo.specs.builders.trigger.RemoteTrigger toSpecsEntity(@NotNull @NotNull TriggerDefinition triggerDefinition) This method receives andTriggerDefinition
. All properties of should already be copied fromTriggerDefinition
. This method returnsRemoteTriggerProperties
with common properties fromAnyTrigger
and custom properties fromTriggerDefinition
- Specified by:
toSpecsEntity
in interfaceTriggerDefinitionExporter
-
validate
public List<com.atlassian.bamboo.specs.api.validators.common.ValidationProblem> validate(@NotNull @NotNull TriggerValidationContext triggerValidationContext, @NotNull @NotNull com.atlassian.bamboo.specs.api.model.trigger.TriggerProperties triggerProperties) Description copied from interface:TriggerDefinitionExporter
Validates trigger properties in context of enclosing plan or deployment properties. Should check for any inconsistencies between trigger definition and the rest of plan or deployment content, as it is provided in the validation context. Returns list of validation errors or empty if everything is ok.Should check RSS permissions if necessary.
- Specified by:
validate
in interfaceTriggerDefinitionExporter
-
toYaml
@Nullable public <T extends com.atlassian.bamboo.specs.api.model.trigger.TriggerProperties> @Nullable Node toYaml(@NotNull T triggerProperties) Description copied from interface:TriggerDefinitionExporter
Convert trigger definition to YAML node. Bamboo might modify returned node to add information about trigger conditions or other general trigger settings. To make it compatible with future versions returned value should be StringNode or MapNode (String, Map). Structure MapNode (String, String) can't be enriched with additional elements and cause runtime failures for some cases.- Specified by:
toYaml
in interfaceTriggerDefinitionExporter
- Returns:
- YAML representation of the trigger.
-
fromYaml
@Nullable public @Nullable com.atlassian.bamboo.specs.builders.trigger.RemoteTrigger fromYaml(@NotNull @NotNull Node node, @NotNull @NotNull TaskValidationContext context) throws YamlSpecsValidationException Description copied from interface:TriggerDefinitionExporter
Parse YAML node to Trigger Specs builder.- Specified by:
fromYaml
in interfaceTriggerDefinitionExporter
- Parameters:
node
- YAML node from user input. In general case it's same node generated byTriggerDefinitionExporter.toYaml(TriggerProperties)
method, but in some cases it might contain additional trigger elements, like conditions. These elements should be ignored by method implementation and will be handled by Bamboo code. In such case MapNode handler should be implemented even ifTriggerDefinitionExporter.toYaml(TriggerProperties)
produces StringNode.context
- task validation context- Throws:
YamlSpecsValidationException
-