Class BuildTypeSuggestion
- java.lang.Object
-
- jetbrains.buildServer.serverSide.healthStatus.HealthStatusReport
-
- jetbrains.buildServer.web.openapi.healthStatus.suggestions.BuildTypeSuggestion
-
- All Implemented Interfaces:
ServerExtension
,TeamCityExtension
public abstract class BuildTypeSuggestion extends HealthStatusReport
Base class for build type suggestions.- Since:
- 8.1
-
-
Constructor Summary
Constructors Constructor Description BuildTypeSuggestion(java.lang.String type, java.lang.String displayName, PagePlaces pagePlaces)
BuildTypeSuggestion(java.lang.String type, PagePlaces pagePlaces)
Deprecated.since 9.0
-
Method Summary
All Methods Instance Methods Abstract Methods Concrete Methods Modifier and Type Method Description boolean
canReportItemsFor(HealthStatusScope scope)
Check whether the report can produce any items accepted by the specified scope.protected java.util.Collection<SBuildType>
filterBuildTypes(HealthStatusScope scope)
Not for all build types suggestions should be shown.java.util.Collection<ItemCategory>
getCategories()
Problems categories producing by this problem finder.java.lang.String
getDisplayName()
User presentable name of the problem finder.abstract java.util.List<BuildTypeSuggestedItem>
getSuggestions(SBuildType buildType)
Returns suggestions for provided build type.java.lang.String
getType()
abstract java.lang.String
getViewUrl()
void
report(HealthStatusScope scope, HealthStatusItemConsumer resultConsumer)
When called must report all found problems to result consumer according to the received scope.-
Methods inherited from class jetbrains.buildServer.serverSide.healthStatus.HealthStatusReport
equals, hashCode
-
-
-
-
Constructor Detail
-
BuildTypeSuggestion
public BuildTypeSuggestion(@NotNull java.lang.String type, @NotNull java.lang.String displayName, @NotNull PagePlaces pagePlaces)
-
BuildTypeSuggestion
@Deprecated public BuildTypeSuggestion(@NotNull java.lang.String type, @NotNull PagePlaces pagePlaces)
Deprecated.since 9.0UseBuildTypeSuggestion(String, String, PagePlaces)
instead.
-
-
Method Detail
-
getType
@NotNull public java.lang.String getType()
- Specified by:
getType
in classHealthStatusReport
- Returns:
- unique identifier of the problem finder
-
getDisplayName
@NotNull public java.lang.String getDisplayName()
Description copied from class:HealthStatusReport
User presentable name of the problem finder.- Specified by:
getDisplayName
in classHealthStatusReport
- Returns:
- name of the problem finder to show in the user interface.
-
getCategories
@NotNull public final java.util.Collection<ItemCategory> getCategories()
Description copied from class:HealthStatusReport
Problems categories producing by this problem finder. All problems of 'undeclared' categories will be filtered even if they were consumed.- Specified by:
getCategories
in classHealthStatusReport
- Returns:
- Unmodifiable not-empty collection of unique categories producing by this problem finder.
-
canReportItemsFor
public boolean canReportItemsFor(@NotNull HealthStatusScope scope)
Description copied from class:HealthStatusReport
Check whether the report can produce any items accepted by the specified scope.HealthStatusReport.report(HealthStatusScope, HealthStatusItemConsumer)
will not be called if this method return false. Implementations should not perform any complex calculations, they are expected to quickly analyzeHealthStatusScope
and return false if it is clear that they can not report any acceptable items. For example, they can return false if they can't produce items with the requested severity (that is accepted byHealthStatusScope.isItemWithSeverityAccepted(ItemSeverity)
).- Specified by:
canReportItemsFor
in classHealthStatusReport
-
report
public void report(@NotNull HealthStatusScope scope, @NotNull HealthStatusItemConsumer resultConsumer)
Description copied from class:HealthStatusReport
When called must report all found problems to result consumer according to the received scope. Always called with system privileges (in all permissions mode) so no permission checks are required. Note that this method can be called quite often, so long-running implementations should return false fromHealthStatusReport.canReportItemsFor(HealthStatusScope)
if it's clear that they can't produce any items for the requested scope. Implementations of this method should always return in a reasonable time. For example, long running computations or network calls should not be made in this method, but rather called in some background thread, their result saved to a cache, and then be read from the cache in this method.- Specified by:
report
in classHealthStatusReport
- Parameters:
scope
- health status coderesultConsumer
- health status item consumer
-
getSuggestions
@NotNull public abstract java.util.List<BuildTypeSuggestedItem> getSuggestions(@NotNull SBuildType buildType)
Returns suggestions for provided build type.- Parameters:
buildType
- build type to provide suggestions for- Returns:
- list of suggestions
-
getViewUrl
@NotNull public abstract java.lang.String getViewUrl()
- Returns:
- url to page or jsp which will render build type suggestion.
-
filterBuildTypes
@NotNull protected java.util.Collection<SBuildType> filterBuildTypes(@NotNull HealthStatusScope scope)
Not for all build types suggestions should be shown. This method performs some basic filtration for build types from the scope, i.e. it filters out all paused build types.- Parameters:
scope
- scope to filter- Returns:
- build types to run suggestions against
-
-