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 booleanaccepts(String logicalBranchName, BranchAttributesContext branchContext, Map<String,String> attributes)BranchAttributesContextgetBranchContext(String logicalBranchName, SBuildType buildType, BranchAttributesPrecalculationContext precalcContext)StringgetId()BranchAttributesPrecalculationContextprecalculateContextForFiltering(SBuildType buildType)voidregisterExtension(ExtensionHolder extensionHolder)TestBranchAttributesDataProvidersetBranchMap(Map<String,String> branchMap)Stringvalidate(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:
 getIdin 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:
 acceptsin interfaceBranchAttributesDataProviderbranchContext- 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:
 validatein interfaceBranchAttributesDataProvider- Returns:
 - null if attributes valid, or the reason why the attributes are incorrect
 
 
- 
precalculateContextForFiltering
@Nullable public BranchAttributesPrecalculationContext precalculateContextForFiltering(@NotNull SBuildType buildType)
- Specified by:
 precalculateContextForFilteringin 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:
 getBranchContextin interfaceBranchAttributesDataProviderbuildType- 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 
 
 - 
 
 -