Interface ResponsibilityManager

  • All Known Implementing Classes:
    InvestigationsManagerImpl

    public interface ResponsibilityManager
    Represents a manager that provides general responsibility actions (like get and set).

    The objects for which the responsibility can be taken are specified by problemIds (represented as strings). Objects can be:

    • build configuration
    • test name
    or something else introduced in future. The problemIds 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
    For each problem any attribute can be changed over time.

    Class is thread-safe, all changes are persistent.

    Since:
    5.0
    Author:
    Maxim Podkolzine (maxim.podkolzine@jetbrains.com)
    • Method Detail

      • setEntry

        void setEntry​(@NotNull
                      String problemId,
                      @NotNull
                      ResponsibilityEntry entry)
        Adds (or updates) the responsibility entry associated with the problemId.
        Parameters:
        problemId - the problem id
        entry - responsibility entry
      • setEntries

        void setEntries​(@NotNull
                        Collection<String> problemIds,
                        @NotNull
                        ResponsibilityEntry entry)
        Inserts the same responsibility entry for several problemIds at once.
        Parameters:
        problemIds - the problem ids
        entry - responsibility entry
        Since:
        8.1
      • findEntry

        @Nullable
        ResponsibilityEntry findEntry​(@NotNull
                                      String problemId)
        Returns the responsibility entry associated with the problemId.
        Parameters:
        problemId - problem id
        Returns:
        responsibility entry
      • findEntries

        List<ResponsibilityEntryEx> findEntries​(@NotNull
                                                Iterable<String> problemIds)
        Returns all responsibility entries associated with given problemIds. 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 the problemId (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 filter
        responsibleId - 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