Class TestBranchAttributesDataProvider
- java.lang.Object
-
- jetbrains.buildServer.serverSide.impl.TestBranchAttributesDataProvider
-
- All Implemented Interfaces:
ServerExtension
,BranchAttributesDataProvider
,TeamCityExtension
public class TestBranchAttributesDataProvider extends Object implements BranchAttributesDataProvider
-
-
Constructor Summary
Constructors Constructor Description TestBranchAttributesDataProvider()
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description boolean
accepts(String logicalBranchName, BranchAttributesContext branchContext, Map<String,String> attributes)
BranchAttributesContext
getBranchContext(String logicalBranchName, SBuildType buildType, BranchAttributesPrecalculationContext precalcContext)
String
getId()
BranchAttributesPrecalculationContext
precalculateContextForFiltering(SBuildType buildType)
void
registerExtension(ExtensionHolder extensionHolder)
TestBranchAttributesDataProvider
setBranchMap(Map<String,String> branchMap)
String
validate(Map<String,String> attributes)
-
-
-
Method Detail
-
setBranchMap
public TestBranchAttributesDataProvider setBranchMap(@NotNull Map<String,String> branchMap)
-
registerExtension
public void registerExtension(@NotNull ExtensionHolder extensionHolder)
-
getId
@NotNull public String getId()
- Specified by:
getId
in interfaceBranchAttributesDataProvider
- Returns:
- id of the current provider. This id should be unique among all providers and will be used in branch filters as identifier for this provider
-
accepts
public boolean accepts(@NotNull String logicalBranchName, @NotNull BranchAttributesContext branchContext, @Nullable Map<String,String> attributes)
- Specified by:
accepts
in interfaceBranchAttributesDataProvider
branchContext
- a context calculated for the branchattributes
- a map of name value pairs, all names should be supported by the provider- Returns:
- true if the given branch has all the provided attributes in the given context
-
validate
public String validate(@Nullable Map<String,String> attributes)
- Specified by:
validate
in interfaceBranchAttributesDataProvider
- Returns:
- null if attributes valid, or the reason why the attributes are incorrect
-
precalculateContextForFiltering
@Nullable public BranchAttributesPrecalculationContext precalculateContextForFiltering(@NotNull SBuildType buildType)
- Specified by:
precalculateContextForFiltering
in interfaceBranchAttributesDataProvider
- Returns:
- a precalculation context which might be helpful when calculating branch context. This context is not always calculated for the filtered branch, only in some cases when multiple branches are being filtered
-
getBranchContext
public BranchAttributesContext getBranchContext(@NotNull String logicalBranchName, @NotNull SBuildType buildType, @Nullable BranchAttributesPrecalculationContext precalcContext)
- Specified by:
getBranchContext
in interfaceBranchAttributesDataProvider
buildType
- buildType for which this logicalBranchName was calculatedprecalcContext
- an optional precalculated context that was computed withBranchAttributesDataProvider.precalculateContextForFiltering(SBuildType)
. Should be used only to speed up calculation and should not be relied on because it is calculated only in cases when multiple branches are supposed to be filtered- Returns:
- branch context for the given logical branch, that will be used in
BranchAttributesDataProvider.accepts(String, BranchAttributesContext, Map)
, can be null if context can't be calculated
-
-