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 StringRELOAD_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.ResponsibilityEntryExfindEntry(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).booleanhasPendingReloadTask()static ResponsibilityEntry.Stateint2State(int stateInt)booleanremoveEntry(String problemId)Returns the entry associated with theproblemId(if exists).voidsetEntries(Collection<String> problemIds, ResponsibilityEntry entry)Inserts the same responsibility entry for severalproblemIds at once.voidsetEntry(String problemId, ResponsibilityEntry entry)Adds (or updates) the responsibility entry associated with theproblemId.voidsetOnExternalChange(BiConsumer<ResponsibilityEntryEx,ResponsibilityEntryEx> listener)Allows to subscribe for the external changes, i.e.static intstate2Int(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:ResponsibilityManagerAdds (or updates) the responsibility entry associated with theproblemId.- Specified by:
setEntryin interfaceResponsibilityManager- Parameters:
problemId- the problem identry- responsibility entry
-
setEntries
public void setEntries(@NotNull Collection<String> problemIds, @NotNull ResponsibilityEntry entry)Description copied from interface:ResponsibilityManagerInserts the same responsibility entry for severalproblemIds at once.- Specified by:
setEntriesin interfaceResponsibilityManager- Parameters:
problemIds- the problem idsentry- responsibility entry
-
findEntry
public ResponsibilityEntryEx findEntry(@NotNull String problemId)
Description copied from interface:ResponsibilityManagerReturns the responsibility entry associated with theproblemId.- Specified by:
findEntryin interfaceResponsibilityManager- Parameters:
problemId- problem id- Returns:
- responsibility entry
-
findEntries
public List<ResponsibilityEntryEx> findEntries(@NotNull Iterable<String> problemIds)
Description copied from interface:ResponsibilityManagerReturns all responsibility entries associated with givenproblemIds. Order of entries is indetermined.- Specified by:
findEntriesin interfaceResponsibilityManager- Parameters:
problemIds- problem id- Returns:
- see above
-
removeEntry
public boolean removeEntry(@NotNull String problemId)Description copied from interface:ResponsibilityManagerReturns the entry associated with theproblemId(if exists).- Specified by:
removeEntryin interfaceResponsibilityManager- Parameters:
problemId- problem id- Returns:
-
getAllEntries
@NotNull public List<ResponsibilityEntryEx> getAllEntries(@Nullable ResponsibilityManager.EntryFilter filter)
Description copied from interface:ResponsibilityManagerReturns all responsibility entries that match the filter (if specified). Consider using #findEntries method, if you know problemIds.- Specified by:
getAllEntriesin 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:ResponsibilityManagerReturns 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:
getAllEntriesForUserin 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:ResponsibilityManagerAllows to subscribe for the external changes, i.e. coming from another node or after projects import.- Specified by:
setOnExternalChangein 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()
-
-