Package com.atlassian.gadgets.dashboard
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 Summary
Modifier and TypeMethodDescriptionget(DashboardId id, String username) Fetch theDashboardStateif the user has permission.io.atlassian.fugue.Option<DashboardState>getDashboardForGadget(GadgetId gadgetId, String username) Gets dashboard state which contains the specified gadgetsave(DashboardState state, String username) Save theDashboardStateif the user has permission.
-
Method Details
-
get
Fetch theDashboardStateif 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:
DashboardStatefor the givenDashboardId- Throws:
PermissionException- thrown if the user does not have permission to read the dashboard
-
save
Save theDashboardStateif the user has permission.- Parameters:
state-DashboardStateto save.username- Username of the user to check permissions on, or null if no user is logged in- Returns:
- refreshed
DashboardStateafter 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 dashboardusername- 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
-