Class TaskConfigurationUtils


  • @Internal
    public class TaskConfigurationUtils
    extends Object
    • Method Detail

      • removeTasksFromConfig

        public static void removeTasksFromConfig​(org.apache.commons.configuration.HierarchicalConfiguration config)
        Removes all tasks from build configuration
        Parameters:
        config -
      • addTaskDefinitionsToConfig

        public static void addTaskDefinitionsToConfig​(@Nullable
                                                      @Nullable List<TaskDefinition> taskDefinitions,
                                                      @NotNull
                                                      @NotNull org.apache.commons.configuration.HierarchicalConfiguration config,
                                                      @NotNull
                                                      @NotNull String taskPrefix)
        Adds tasks to a build configuration
        Parameters:
        taskDefinitions -
        config -
        taskPrefix -
      • getTaskDefinitionsFromConfig

        @NotNull
        public static @NotNull List<TaskDefinition> getTaskDefinitionsFromConfig​(String taskPrefix,
                                                                                 org.apache.commons.configuration.HierarchicalConfiguration fromConfig)
        Retrieves tasks from build configuration
        Parameters:
        taskPrefix -
        fromConfig -
        Returns:
      • getUniqueId

        public static long getUniqueId​(@NotNull
                                       @NotNull List<TaskDefinition> tasks)
        Returns id of task that is not used in provided list.
        Parameters:
        tasks -
        Returns:
      • adjustFinalisingBar

        public static void adjustFinalisingBar​(@NotNull
                                               @NotNull List<TaskDefinition> tasks,
                                               long beforeId,
                                               long afterId)
      • getMaxTaskOid

        @Nullable
        public static @Nullable BambooEntityOid getMaxTaskOid​(int serverKey)
        Returns the max BambooEntityOid that's currently in use of BambooEntityType.TASK type, with the given server key. Returns null if no OIDs are in use of this type with the given server key.
      • replaceCapabilityLabelInTasks

        @NotNull
        public static @NotNull Optional<List<TaskDefinition>> replaceCapabilityLabelInTasks​(@NotNull
                                                                                            @NotNull List<TaskDefinition> taskDefinitions,
                                                                                            @NotNull
                                                                                            @NotNull String keyToReplace,
                                                                                            @NotNull
                                                                                            @NotNull String oldCapabilityLabel,
                                                                                            @NotNull
                                                                                            @NotNull String newCapabilityLabel,
                                                                                            @NotNull
                                                                                            @NotNull String oldCapabilityKey,
                                                                                            @NotNull
                                                                                            @NotNull String newCapabilityKey)
        Replaces references to a capability in tasks from the list with a new capability key.
        Returns:
        modified task list, or empty if no changes performed