Interface TrackingEntryManager

All Known Implementing Classes:
TrackingEntryManagerImpl

public interface TrackingEntryManager
For managing all things tracking related!
  • Method Details

    • getTrackingEntryById

      @Nullable @Nullable TrackingEntry getTrackingEntryById(int id)
      Find tracking entry by database id
      Parameters:
      id - of tracking entry to find
      Returns:
      tracking entry with given id if found, otherwise null
    • getTrackingEntryByResultId

      @Nullable @Nullable TrackingEntry getTrackingEntryByResultId(long resultId)
      Find the tracking entry for a given chain result.
      Parameters:
      resultId - of the result
      Returns:
      tracking entry for the given result. null if none exists (e.g if result is green!)
    • getActiveTrackingEntryForPlan

      @Nullable @Nullable TrackingEntry getActiveTrackingEntryForPlan(long id)
      Returns the currently open tracking entry for plan. Only one tracking entry is allowed open per plan at any one time. If multiple are found. They are all closed and this method will return null. Will also return null if there is no currently active entry (i.e the plan is currently passing)
      Parameters:
      id - of the plan
      Returns:
      currently active tracking entry for the plan if there is one
    • addResult

      void addResult(@NotNull @NotNull TrackingEntry entry, long resultId, int buildNumber)
      Add a result to an existing tracking entry
      Parameters:
      entry - to add result to
      resultId - id of the result to add
      buildNumber -
    • addUser

      void addUser(@NotNull @NotNull TrackingEntry entry, @NotNull @NotNull String user, @Nullable @Nullable String userWhoUpdated)
      Add a responsible user to an existing tracking entry
      Parameters:
      entry - to add user too
      user - to add
      userWhoUpdated - user who updated the responsibility entry. Null if responsibility has been automatically assigned
    • removeUser

      void removeUser(@NotNull @NotNull TrackingEntry entry, @NotNull @NotNull String user)
      Remove a responsible user from existing tracking entry
      Parameters:
      entry - to remove user from
      user - to remove
    • removeAllUsers

      void removeAllUsers(@NotNull @NotNull TrackingEntry entry)
      Removes all existing responsible users from the existing tracking entry.
      Parameters:
      entry - to remove users from
    • closeTrackingEntry

      void closeTrackingEntry(@NotNull @NotNull TrackingEntry entry)
      Close a tracking entry. Essentially you do this when it no longer needs attention. e.g. if the build is now green.
      Parameters:
      entry - to close
    • createTrackingEntry

      @NotNull @NotNull TrackingEntry createTrackingEntry(long planId, boolean active)
      Create a brand new tracking entry for this plan. Will be active by default, ensure there are no other active tracking entries before creating a new one
      Parameters:
      planId - of plan
      active - should the new entry be created as active entry
      Returns:
      created tracking entry
    • getActiveTrackingEntriesForUser

      @NotNull @NotNull Collection<TrackingEntry> getActiveTrackingEntriesForUser(@NotNull @NotNull String username)
      Find any active tracking entries for a given user. This represents the plans they currently are responsible for
      Parameters:
      username - of the user
      Returns:
      any active tracking entries for the given user.
    • getActiveTrackingEntriesForUser

      List<TrackingEntry> getActiveTrackingEntriesForUser(@NotNull @NotNull String username, int start, int limit)
    • removeTrackingForPlan

      void removeTrackingForPlan(long idOfDeletedPlan)
      Remove any tracking information for a given plan
      Parameters:
      idOfDeletedPlan - db id of the plan
    • removeTrackingForResult

      void removeTrackingForResult(long idOfDeletedResult)
      Remove any tracking information for a given result
      Parameters:
      idOfDeletedResult - db if of the result
    • removeTrackingEntry

      void removeTrackingEntry(TrackingEntry trackingEntry)
      Remove entire tracking entry.
      Parameters:
      trackingEntry -
    • setActiveEntry

      void setActiveEntry(TrackingEntry trackingEntry)
      Sets tracing entry to active. Caller must ensure that there's no other open tracking entry.
      Parameters:
      trackingEntry -
    • getTrackingEntryWithBuildNumber

      @Nullable @Nullable TrackingEntry getTrackingEntryWithBuildNumber(long planId, int buildNumber)
      Find the tracking entry with given build number.
      Parameters:
      planId -
      buildNumber -