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 String
checkIssueIdBeforeTestConnection(String issueId)
Collection<IssueMention>
getRelatedIssues(String comment)
Returns the collection of issues related, or mentioned in the comment.protected boolean
isCharacterSupported(char c)
Checks if character is supported by current issue providerboolean
isHasRelatedIssues(String comment)
Returns whether there are related issues in the specifiedcomment
.void
setProperties(Map<String,String> map)
Sets the provider properties (seeIssueProvider.getProperties()
method for the details).protected boolean
useIdPrefix()
-
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:
useIdPrefix
in classAbstractIssueProvider
-
getRelatedIssues
@NotNull public Collection<IssueMention> getRelatedIssues(@NotNull String comment)
Description copied from interface:IssueProvider
Returns the collection of issues related, or mentioned in the comment. The relation can be defined by a mention in the text (a mention means thatcomment
contains the substring that matches a certain pattern), or by any way the plugin chooses.- Specified by:
getRelatedIssues
in interfaceIssueProvider
- Overrides:
getRelatedIssues
in 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:IssueProvider
Returns whether there are related issues in the specifiedcomment
. The relation can be defined by a mention in the text (a mention means thatcomment
contains the substring that matches a certain pattern), or by any way the plugin chooses.- Specified by:
isHasRelatedIssues
in interfaceIssueProvider
- Overrides:
isHasRelatedIssues
in 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:IssueProvider
Sets 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:
setProperties
in interfaceIssueProvider
- Overrides:
setProperties
in 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:
true
if given character is letter
-
checkIssueIdBeforeTestConnection
@Nullable protected String checkIssueIdBeforeTestConnection(@NotNull String issueId)
- Overrides:
checkIssueIdBeforeTestConnection
in classAbstractIssueProvider
-
-