Interface DashboardService


@ParametersAreNonnullByDefault public interface DashboardService
Service that saves or fetches the DashboardState, after checking to make sure that the user has access to the dashboard.
  • Method Details

    • get

      DashboardState get(DashboardId id, @Nullable String username) throws PermissionException
      Fetch the DashboardState if the user has permission.
      Parameters:
      id - Id of the dashboard to fetch.
      username - Username of the user to check permissions on, or null if no user is logged in
      Returns:
      DashboardState for the given DashboardId
      Throws:
      PermissionException - thrown if the user does not have permission to read the dashboard
    • save

      DashboardState save(DashboardState state, @Nullable String username) throws PermissionException
      Save the DashboardState if the user has permission.
      Parameters:
      state - DashboardState to save.
      username - Username of the user to check permissions on, or null if no user is logged in
      Returns:
      refreshed DashboardState after the state object has been saved
      Throws:
      PermissionException - thrown if the user does not have permission to modify the dashboard
    • getDashboardForGadget

      io.atlassian.fugue.Option<DashboardState> getDashboardForGadget(GadgetId gadgetId, @Nullable String username) throws PermissionException
      Gets dashboard state which contains the specified gadget
      Parameters:
      gadgetId - id of the gadget contained in the returned dashboard
      username - Username of the user to check permissions on, or null if no user is logged in
      Returns:
      dashboard containing the gadget or none() if such a dashboard or gadget does not exist
      Throws:
      PermissionException - thrown if the user does not have permissions to access the dashboard