Class AbstractPrefixBasedIssueProvider
- java.lang.Object
-
- jetbrains.buildServer.issueTracker.AbstractIssueProvider
-
- jetbrains.buildServer.issueTracker.AbstractPrefixBasedIssueProvider
-
- All Implemented Interfaces:
IssueBatchProviderSupport,IssueProvider,SIssueProvider
public class AbstractPrefixBasedIssueProvider extends AbstractIssueProvider
A custom implementation of the provider for a specific case when issue ids are like"FOO-123", for instance JIRA and YouTrack.Implementation doesn't use regular expressions and thus very fast.
- Since:
- 8.0
- Author:
- Maxim Podkolzine (maxim.podkolzine@jetbrains.com)
-
-
Field Summary
-
Fields inherited from class jetbrains.buildServer.issueTracker.AbstractIssueProvider
EMPTY_PATTERN, LOG, myCredentials, myFetcher, myFetchHost, myHost, myPattern, myProperties, myType, REGEX_ISSUES_TIMEOUS_MS
-
Fields inherited from interface jetbrains.buildServer.issueTracker.IssueProvider
SECURE_PROPERTY_PREFIX
-
-
Constructor Summary
Constructors Constructor Description AbstractPrefixBasedIssueProvider(String type, IssueFetcher fetcher)
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description protected StringcheckIssueIdBeforeTestConnection(String issueId)Collection<IssueMention>getRelatedIssues(String comment)Returns the collection of issues related, or mentioned in the comment.protected booleanisCharacterSupported(char c)Checks if character is supported by current issue providerbooleanisHasRelatedIssues(String comment)Returns whether there are related issues in the specifiedcomment.voidsetProperties(Map<String,String> map)Sets the provider properties (seeIssueProvider.getProperties()method for the details).protected booleanuseIdPrefix()-
Methods inherited from class jetbrains.buildServer.issueTracker.AbstractIssueProvider
compileDisjunction, compilePattern, dispose, extractId, fetchProjectIds, findIssueById, findIssuesByIds, findIssuesByIdsImpl, findPossiblyExpiredIssue, fixUrl, getAuthenticator, getCommentTransformationHelper, getConfigurationSummary, getFetchHost, getIssueViewUrl, getProperties, getPropertiesProcessor, getRelatedIssues, getTestConnectionSupport, getType, isBatchFetchSupported, isFailedToFetch, isFetched, isHasRelatedIssues, isIdPrefixMandatory, quickCheck, safeCompile, sanitizeHost, toString
-
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
-
Methods inherited from interface jetbrains.buildServer.issueTracker.SIssueProvider
getAdditionalTestData
-
-
-
-
Constructor Detail
-
AbstractPrefixBasedIssueProvider
public AbstractPrefixBasedIssueProvider(@NotNull String type, @NotNull IssueFetcher fetcher)
-
-
Method Detail
-
useIdPrefix
protected boolean useIdPrefix()
- Overrides:
useIdPrefixin classAbstractIssueProvider
-
getRelatedIssues
@NotNull public Collection<IssueMention> getRelatedIssues(@NotNull String comment)
Description copied from interface:IssueProviderReturns the collection of issues related, or mentioned in the comment. The relation can be defined by a mention in the text (a mention means thatcommentcontains the substring that matches a certain pattern), or by any way the plugin chooses.- Specified by:
getRelatedIssuesin interfaceIssueProvider- Overrides:
getRelatedIssuesin classAbstractIssueProvider- Parameters:
comment- the comment- Returns:
- collection of related issues
- See Also:
IssueProvider.isHasRelatedIssues(String)
-
isHasRelatedIssues
public boolean isHasRelatedIssues(@NotNull String comment)Description copied from interface:IssueProviderReturns whether there are related issues in the specifiedcomment. The relation can be defined by a mention in the text (a mention means thatcommentcontains the substring that matches a certain pattern), or by any way the plugin chooses.- Specified by:
isHasRelatedIssuesin interfaceIssueProvider- Overrides:
isHasRelatedIssuesin classAbstractIssueProvider- Parameters:
comment- the comment- Returns:
- true if the comment has related issues
- See Also:
IssueProvider.getRelatedIssues(String)
-
setProperties
public void setProperties(@NotNull Map<String,String> map)Description copied from interface:IssueProviderSets the provider properties (seeIssueProvider.getProperties()method for the details).Few words about thread-safety: properties can be changed from the admin UI, or in config file. By any of these events this method is called (synchronously). Hence this method should lock any other API method.
- Specified by:
setPropertiesin interfaceIssueProvider- Overrides:
setPropertiesin classAbstractIssueProvider- Parameters:
map- a properties map- See Also:
IssueProvider.getProperties()
-
isCharacterSupported
protected boolean isCharacterSupported(char c)
Checks if character is supported by current issue provider- Parameters:
c- char to check- Returns:
trueif given character is letter
-
checkIssueIdBeforeTestConnection
@Nullable protected String checkIssueIdBeforeTestConnection(@NotNull String issueId)
- Overrides:
checkIssueIdBeforeTestConnectionin classAbstractIssueProvider
-
-