Package com.atlassian.bamboo.plugin
Class BambooPluginUtils
- java.lang.Object
-
- com.atlassian.bamboo.plugin.BambooPluginUtils
-
public class BambooPluginUtils extends Object
-
-
Nested Class Summary
Nested Classes Modifier and Type Class Description static class
BambooPluginUtils.Callable<V>
static class
BambooPluginUtils.NoThrowCallable<V>
static class
BambooPluginUtils.Runnable
-
Field Summary
Fields Modifier and Type Field Description static String
BAMBOO_APPLICATION_KEY
static String
PLUGIN_DESCRIPTOR_FILENAME
-
Method Summary
All Methods Static Methods Concrete Methods Modifier and Type Method Description static <V> V
callChangedApi(Callable<V> newMethod, Callable<V> oldMethod)
static <T> T
callUnsafeCode(BambooPluginUtils.Callable<T> callable)
Calls call() method on the supplied callable.static Iterable<TaskDefinition>
filterEnabledTasks(BuildContext buildContext, String pluginKey)
static <T extends TaskDefinition>
Iterable<T>filterEnabledTasks(Iterable<T> taskDefinitions, String pluginKey)
static Iterable<TaskDefinition>
filterTasks(ImmutableJob job, String pluginKey)
static Iterable<TaskDefinition>
filterTasks(BuildContext buildContext, String pluginKey)
static Iterable<TaskDefinition>
filterTasks(Iterable<TaskDefinition> taskDefinitions, String pluginKey)
static <T extends TaskDefinition>
Iterable<T>filterTasks(Iterable<T> taskDefinitions, com.google.common.base.Predicate<TaskDefinition>... predicates)
static @NotNull com.google.common.collect.Ordering<com.atlassian.plugin.ModuleDescriptor<?>>
getModuleDescriptorNameOrdering()
static <T> T
instantiateModule(com.atlassian.plugin.ModuleDescriptor<T> md)
static Predicate<TaskProcessCommandDecoratorModuleDescriptor>
isTaskProcessCommandDecoratorApplicableTo(@NotNull TaskIdentifier taskIdentifier)
static Predicate<PluginKeyProvider>
pluginKeyEquals(String pluginKey)
static String
prepareSubModuleConfiguration(org.dom4j.Element element, io.atlassian.util.concurrent.ResettableLazyReference<?> reference, String elementName, String key, String name, String pluginKey)
Prepares a sub-module by finding its class name and resetting its existingResettableLazyReference
-
-
-
Field Detail
-
BAMBOO_APPLICATION_KEY
public static final String BAMBOO_APPLICATION_KEY
- See Also:
- Constant Field Values
-
PLUGIN_DESCRIPTOR_FILENAME
public static final String PLUGIN_DESCRIPTOR_FILENAME
- See Also:
- Constant Field Values
-
-
Method Detail
-
callUnsafeCode
@Nullable public static <T> T callUnsafeCode(BambooPluginUtils.Callable<T> callable)
Calls call() method on the supplied callable. RuntimeExceptions are logged and swallowed.- Type Parameters:
T
-- Parameters:
callable
- a callable wrapping unsafe plugin calls- Returns:
-
instantiateModule
public static <T> T instantiateModule(com.atlassian.plugin.ModuleDescriptor<T> md)
-
isTaskProcessCommandDecoratorApplicableTo
public static Predicate<TaskProcessCommandDecoratorModuleDescriptor> isTaskProcessCommandDecoratorApplicableTo(@NotNull @NotNull TaskIdentifier taskIdentifier)
-
getModuleDescriptorNameOrdering
@NotNull public static @NotNull com.google.common.collect.Ordering<com.atlassian.plugin.ModuleDescriptor<?>> getModuleDescriptorNameOrdering()
-
filterTasks
public static Iterable<TaskDefinition> filterTasks(BuildContext buildContext, String pluginKey)
-
filterEnabledTasks
public static Iterable<TaskDefinition> filterEnabledTasks(BuildContext buildContext, String pluginKey)
-
filterTasks
public static Iterable<TaskDefinition> filterTasks(Iterable<TaskDefinition> taskDefinitions, String pluginKey)
-
filterTasks
public static <T extends TaskDefinition> Iterable<T> filterTasks(Iterable<T> taskDefinitions, com.google.common.base.Predicate<TaskDefinition>... predicates)
-
filterEnabledTasks
public static <T extends TaskDefinition> Iterable<T> filterEnabledTasks(Iterable<T> taskDefinitions, String pluginKey)
-
filterTasks
public static Iterable<TaskDefinition> filterTasks(ImmutableJob job, String pluginKey)
-
prepareSubModuleConfiguration
public static String prepareSubModuleConfiguration(org.dom4j.Element element, io.atlassian.util.concurrent.ResettableLazyReference<?> reference, String elementName, String key, String name, String pluginKey)
Prepares a sub-module by finding its class name and resetting its existingResettableLazyReference
- Parameters:
element
- sub-element namereference
- of the sub-moduleelementName
- of the sub-modulekey
-name
-pluginKey
-- Returns:
- className
-
pluginKeyEquals
public static Predicate<PluginKeyProvider> pluginKeyEquals(String pluginKey)
-
-