Class InvestigationsManagerImpl
- java.lang.Object
-
- jetbrains.buildServer.responsibility.impl.InvestigationsManagerImpl
-
- All Implemented Interfaces:
ResponsibilityManager
public class InvestigationsManagerImpl extends Object implements ResponsibilityManager
Thread-safe, persistent.Performance: since 9.1, for most operations uses full-in-memory cache for all investigations.
- Author:
- Maxim Podkolzine (maxim.podkolzine@jetbrains.com), KIR
-
-
Nested Class Summary
-
Nested classes/interfaces inherited from interface jetbrains.buildServer.responsibility.ResponsibilityManager
ResponsibilityManager.EntryFilter
-
-
Field Summary
Fields Modifier and Type Field Description static String
RELOAD_FROM_DB_DELAY
-
Constructor Summary
Constructors Constructor Description InvestigationsManagerImpl(SQLRunnerEx SQLRunner, UserModel userModel, EventDispatcher<ProjectsImportListener> projectImportListenerEventDispatcher, ServerResponsibility serverResponsibility, ExecutorServices executorServices, MultiNodesEvents multiNodesEvents, ResetCacheRegister resetCacheRegister)
-
Method Summary
All Methods Static Methods Instance Methods Concrete Methods Modifier and Type Method Description List<ResponsibilityEntryEx>
findEntries(Iterable<String> problemIds)
Returns all responsibility entries associated with givenproblemIds
.ResponsibilityEntryEx
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
hasPendingReloadTask()
static ResponsibilityEntry.State
int2State(int stateInt)
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.static int
state2Int(ResponsibilityEntry.State state)
-
-
-
Field Detail
-
RELOAD_FROM_DB_DELAY
public static final String RELOAD_FROM_DB_DELAY
- See Also:
- Constant Field Values
-
-
Constructor Detail
-
InvestigationsManagerImpl
public InvestigationsManagerImpl(@NotNull SQLRunnerEx SQLRunner, @NotNull UserModel userModel, @NotNull EventDispatcher<ProjectsImportListener> projectImportListenerEventDispatcher, @NotNull ServerResponsibility serverResponsibility, @NotNull ExecutorServices executorServices, @NotNull MultiNodesEvents multiNodesEvents, @NotNull ResetCacheRegister resetCacheRegister)
-
-
Method Detail
-
setEntry
public void setEntry(@NotNull String problemId, @NotNull ResponsibilityEntry entry)
Description copied from interface:ResponsibilityManager
Adds (or updates) the responsibility entry associated with theproblemId
.- Specified by:
setEntry
in interfaceResponsibilityManager
- Parameters:
problemId
- the problem identry
- responsibility entry
-
setEntries
public void setEntries(@NotNull Collection<String> problemIds, @NotNull ResponsibilityEntry entry)
Description copied from interface:ResponsibilityManager
Inserts the same responsibility entry for severalproblemId
s at once.- Specified by:
setEntries
in interfaceResponsibilityManager
- Parameters:
problemIds
- the problem idsentry
- responsibility entry
-
findEntry
public ResponsibilityEntryEx findEntry(@NotNull String problemId)
Description copied from interface:ResponsibilityManager
Returns the responsibility entry associated with theproblemId
.- Specified by:
findEntry
in interfaceResponsibilityManager
- Parameters:
problemId
- problem id- Returns:
- responsibility entry
-
findEntries
public List<ResponsibilityEntryEx> findEntries(@NotNull Iterable<String> problemIds)
Description copied from interface:ResponsibilityManager
Returns all responsibility entries associated with givenproblemIds
. Order of entries is indetermined.- Specified by:
findEntries
in interfaceResponsibilityManager
- Parameters:
problemIds
- problem id- Returns:
- see above
-
removeEntry
public boolean removeEntry(@NotNull String problemId)
Description copied from interface:ResponsibilityManager
Returns the entry associated with theproblemId
(if exists).- Specified by:
removeEntry
in interfaceResponsibilityManager
- Parameters:
problemId
- problem id- Returns:
-
getAllEntries
@NotNull public List<ResponsibilityEntryEx> getAllEntries(@Nullable ResponsibilityManager.EntryFilter filter)
Description copied from interface:ResponsibilityManager
Returns all responsibility entries that match the filter (if specified). Consider using #findEntries method, if you know problemIds.- Specified by:
getAllEntries
in interfaceResponsibilityManager
- Parameters:
filter
- entry filter- Returns:
- list of entries
-
getAllEntriesForUser
@NotNull public List<ResponsibilityEntryEx> getAllEntriesForUser(@Nullable ResponsibilityManager.EntryFilter filter, long responsibleId)
Description copied from interface:ResponsibilityManager
Returns all responsibility entries assigned for the specified user and that match the filter (if specified).Can be much more effective than
ResponsibilityManager.getAllEntries(EntryFilter)
if the filter by responsible user is required.- Specified by:
getAllEntriesForUser
in interfaceResponsibilityManager
- Parameters:
filter
- entry filterresponsibleId
- the id of responsible user- Returns:
- list of entries
-
setOnExternalChange
public void setOnExternalChange(BiConsumer<ResponsibilityEntryEx,ResponsibilityEntryEx> listener)
Description copied from interface:ResponsibilityManager
Allows to subscribe for the external changes, i.e. coming from another node or after projects import.- Specified by:
setOnExternalChange
in interfaceResponsibilityManager
- Parameters:
listener
- should accept nulls as first or second argument
-
state2Int
public static int state2Int(@NotNull ResponsibilityEntry.State state)
-
int2State
public static ResponsibilityEntry.State int2State(int stateInt)
-
hasPendingReloadTask
public boolean hasPendingReloadTask()
-
-