Package com.atlassian.bamboo.trigger
Class TriggerConfigurationUtils
- java.lang.Object
-
- com.atlassian.bamboo.trigger.TriggerConfigurationUtils
-
@Internal public class TriggerConfigurationUtils extends Object
-
-
Field Summary
Fields Modifier and Type Field Description static String
CONDITIONS
static String
CONFIG
static String
IS_ENABLED
static String
ITEM
static String
NAME
static String
PLUGIN_KEY
static String
TRIGGER_CONFIG_ROOT
static String
TRIGGER_DEF_PREFIX
static String
TRIGGER_DEFINITION
static String
TRIGGER_PREFIX
static String
TRIGGERING_REPOSITORIES
static String
TRIGGERS_DEFINED
static String
USER_DESCRIPTION
-
Method Summary
All Methods Static Methods Concrete Methods Modifier and Type Method Description static void
addTriggerDefinitionsToConfig(@Nullable Iterable<TriggerDefinition> triggerDefinitions, @NotNull org.apache.commons.configuration.HierarchicalConfiguration config)
Adds tasks to a build configurationstatic Map<String,String>
extractTriggerConditionConfiguration(org.apache.commons.configuration.HierarchicalConfiguration configuration)
static @NotNull Set<Long>
extractTriggeringRepositoriesFromCfgString(@NotNull String triggeringRepositoriesString)
static @Nullable TriggerDefinition
getTriggerDefinitionById(@NotNull Iterable<TriggerDefinition> triggers, long id)
static @Nullable com.google.common.collect.ImmutableList<TriggerDefinition>
getTriggerDefinitionsFromConfig(org.apache.commons.configuration.HierarchicalConfiguration fromConfig)
Retrieves tasks from build configurationstatic @NotNull com.google.common.collect.ImmutableList<TriggerDefinition>
getTriggerDefinitionsFromConfigNotNull(org.apache.commons.configuration.HierarchicalConfiguration buildConfiguration)
static long
getUniqueId(@NotNull List<TriggerDefinition> triggers)
Returns id of trigger that is not used in provided list.static void
removeRepositoryIdsFromTriggers(List<TriggerDefinition> triggers, Set<Long> removedRepositoryIds)
static void
removeTriggersFromConfig(org.apache.commons.configuration.HierarchicalConfiguration config)
Removes all tasks from build configurationstatic void
triggerConditionsToConfiguration(org.apache.commons.configuration.HierarchicalConfiguration buildConfiguration, TriggerDefinition triggerDefinition)
static @NotNull String
triggeringRepositoriesToString(@NotNull Set<Long> triggeringRepositories)
static void
updateRepositoryIdsInTriggers(List<TriggerDefinition> triggers, Map<Long,Long> repositoryIdsChanges)
-
-
-
Field Detail
-
TRIGGER_CONFIG_ROOT
public static final String TRIGGER_CONFIG_ROOT
- See Also:
- Constant Field Values
-
TRIGGER_PREFIX
public static final String TRIGGER_PREFIX
- See Also:
- Constant Field Values
-
TRIGGERS_DEFINED
public static final String TRIGGERS_DEFINED
- See Also:
- Constant Field Values
-
TRIGGERING_REPOSITORIES
public static final String TRIGGERING_REPOSITORIES
- See Also:
- Constant Field Values
-
NAME
public static final String NAME
- See Also:
- Constant Field Values
-
PLUGIN_KEY
public static final String PLUGIN_KEY
- See Also:
- Constant Field Values
-
USER_DESCRIPTION
public static final String USER_DESCRIPTION
- See Also:
- Constant Field Values
-
IS_ENABLED
public static final String IS_ENABLED
- See Also:
- Constant Field Values
-
CONFIG
public static final String CONFIG
- See Also:
- Constant Field Values
-
ITEM
public static final String ITEM
- See Also:
- Constant Field Values
-
CONDITIONS
public static final String CONDITIONS
- See Also:
- Constant Field Values
-
TRIGGER_DEFINITION
public static final String TRIGGER_DEFINITION
- See Also:
- Constant Field Values
-
TRIGGER_DEF_PREFIX
public static final String TRIGGER_DEF_PREFIX
- See Also:
- Constant Field Values
-
-
Method Detail
-
removeTriggersFromConfig
public static void removeTriggersFromConfig(org.apache.commons.configuration.HierarchicalConfiguration config)
Removes all tasks from build configuration- Parameters:
config
-
-
addTriggerDefinitionsToConfig
public static void addTriggerDefinitionsToConfig(@Nullable @Nullable Iterable<TriggerDefinition> triggerDefinitions, @NotNull @NotNull org.apache.commons.configuration.HierarchicalConfiguration config)
Adds tasks to a build configuration- Parameters:
triggerDefinitions
-config
-
-
getTriggerDefinitionsFromConfig
@Nullable public static @Nullable com.google.common.collect.ImmutableList<TriggerDefinition> getTriggerDefinitionsFromConfig(org.apache.commons.configuration.HierarchicalConfiguration fromConfig)
Retrieves tasks from build configuration- Parameters:
fromConfig
-- Returns:
-
extractTriggeringRepositoriesFromCfgString
@NotNull public static @NotNull Set<Long> extractTriggeringRepositoriesFromCfgString(@NotNull @NotNull String triggeringRepositoriesString)
-
triggeringRepositoriesToString
@NotNull public static @NotNull String triggeringRepositoriesToString(@NotNull @NotNull Set<Long> triggeringRepositories)
-
getTriggerDefinitionById
@Nullable public static @Nullable TriggerDefinition getTriggerDefinitionById(@NotNull @NotNull Iterable<TriggerDefinition> triggers, long id)
-
getUniqueId
public static long getUniqueId(@NotNull @NotNull List<TriggerDefinition> triggers)
Returns id of trigger that is not used in provided list.- Parameters:
triggers
-- Returns:
-
getTriggerDefinitionsFromConfigNotNull
@NotNull public static @NotNull com.google.common.collect.ImmutableList<TriggerDefinition> getTriggerDefinitionsFromConfigNotNull(org.apache.commons.configuration.HierarchicalConfiguration buildConfiguration)
-
updateRepositoryIdsInTriggers
public static void updateRepositoryIdsInTriggers(List<TriggerDefinition> triggers, Map<Long,Long> repositoryIdsChanges)
-
removeRepositoryIdsFromTriggers
public static void removeRepositoryIdsFromTriggers(List<TriggerDefinition> triggers, Set<Long> removedRepositoryIds)
-
triggerConditionsToConfiguration
public static void triggerConditionsToConfiguration(org.apache.commons.configuration.HierarchicalConfiguration buildConfiguration, TriggerDefinition triggerDefinition)
-
-