Interface ResponsibilityManager
-
- All Known Implementing Classes:
InvestigationsManagerImpl
public interface ResponsibilityManager
Represents a manager that provides general responsibility actions (likeget
andset
).The objects for which the responsibility can be taken are specified by
problemId
s (represented as strings). Objects can be:- build configuration
- test name
problemId
s should be unique among all objects of all types.The attributes that are associated with the given problem are specified by
ResponsibilityEntry
, including:- current state (taken, fixed, etc)
- responsible user / action performer
- etc
Class is thread-safe, all changes are persistent.
- Since:
- 5.0
- Author:
- Maxim Podkolzine (maxim.podkolzine@jetbrains.com)
-
-
Nested Class Summary
Nested Classes Modifier and Type Interface Description static interface
ResponsibilityManager.EntryFilter
-
Method Summary
All Methods Instance Methods Abstract Methods Modifier and Type Method Description List<ResponsibilityEntryEx>
findEntries(Iterable<String> problemIds)
Returns all responsibility entries associated with givenproblemIds
.ResponsibilityEntry
findEntry(String problemId)
Returns the responsibility entry associated with theproblemId
.List<ResponsibilityEntryEx>
getAllEntries(ResponsibilityManager.EntryFilter filter)
Returns all responsibility entries that match the filter (if specified).List<ResponsibilityEntryEx>
getAllEntriesForUser(ResponsibilityManager.EntryFilter filter, long responsibleId)
Returns all responsibility entries assigned for the specified user and that match the filter (if specified).boolean
removeEntry(String problemId)
Returns the entry associated with theproblemId
(if exists).void
setEntries(Collection<String> problemIds, ResponsibilityEntry entry)
Inserts the same responsibility entry for severalproblemId
s at once.void
setEntry(String problemId, ResponsibilityEntry entry)
Adds (or updates) the responsibility entry associated with theproblemId
.void
setOnExternalChange(BiConsumer<ResponsibilityEntryEx,ResponsibilityEntryEx> listener)
Allows to subscribe for the external changes, i.e.
-
-
-
Method Detail
-
setEntry
void setEntry(@NotNull String problemId, @NotNull ResponsibilityEntry entry)
Adds (or updates) the responsibility entry associated with theproblemId
.- Parameters:
problemId
- the problem identry
- responsibility entry
-
setEntries
void setEntries(@NotNull Collection<String> problemIds, @NotNull ResponsibilityEntry entry)
Inserts the same responsibility entry for severalproblemId
s at once.- Parameters:
problemIds
- the problem idsentry
- responsibility entry- Since:
- 8.1
-
findEntry
@Nullable ResponsibilityEntry findEntry(@NotNull String problemId)
Returns the responsibility entry associated with theproblemId
.- Parameters:
problemId
- problem id- Returns:
- responsibility entry
-
findEntries
List<ResponsibilityEntryEx> findEntries(@NotNull Iterable<String> problemIds)
Returns all responsibility entries associated with givenproblemIds
. Order of entries is indetermined.- Parameters:
problemIds
- problem id- Returns:
- see above
- Since:
- 9.1
-
removeEntry
boolean removeEntry(@NotNull String problemId)
Returns the entry associated with theproblemId
(if exists).- Parameters:
problemId
- problem id- Returns:
-
getAllEntries
@NotNull List<ResponsibilityEntryEx> getAllEntries(@Nullable ResponsibilityManager.EntryFilter filter)
Returns all responsibility entries that match the filter (if specified). Consider using #findEntries method, if you know problemIds.- Parameters:
filter
- entry filter- Returns:
- list of entries
-
getAllEntriesForUser
@NotNull List<ResponsibilityEntryEx> getAllEntriesForUser(@Nullable ResponsibilityManager.EntryFilter filter, long responsibleId)
Returns all responsibility entries assigned for the specified user and that match the filter (if specified).Can be much more effective than
getAllEntries(EntryFilter)
if the filter by responsible user is required.- Parameters:
filter
- entry filterresponsibleId
- the id of responsible user- Returns:
- list of entries
-
setOnExternalChange
void setOnExternalChange(BiConsumer<ResponsibilityEntryEx,ResponsibilityEntryEx> listener)
Allows to subscribe for the external changes, i.e. coming from another node or after projects import.- Parameters:
listener
- should accept nulls as first or second argument- Since:
- 2018.1
-
-