com.atlassian.gadgets.dashboard.spi
Interface DashboardStateStore

All Known Implementing Classes:
PluginSettingsDashboardStateStore, TransactionalDashboardStateStoreImpl

public interface DashboardStateStore

Provides a means for looking up, updating and removing DashboardState objects to/from the persistent store.

Since:
2.0

Method Summary
 DashboardState findDashboardWithGadget(GadgetId gadgetId)
          Retrieve the DashboardState for the dashboard containing the gadget whose identifier is gadgetID
 void remove(DashboardId id)
          Removes the DashboardState identified by the DashboardId from the persistent data store.
 DashboardState retrieve(DashboardId id)
          Retrieve the DashboardState with the DashboardId from the data store.
 DashboardState update(DashboardState dashboardState, Iterable<DashboardChange> changes)
          Update the stored DashboardState in the persistent data store, using the changes passed in.
 

Method Detail

retrieve

DashboardState retrieve(DashboardId id)
                        throws DashboardNotFoundException,
                               DashboardStateStoreException
Retrieve the DashboardState with the DashboardId from the data store.

Parameters:
id - unique identifier of the DashboardState object to retrieve
Returns:
the DashboardState object corresponding to the DashboardId
Throws:
DashboardNotFoundException - thrown if there is no DashboardState object with the given id
DashboardStateStoreException - thrown if there is a problem when retrieving the DashboardState from the persistent store

update

DashboardState update(DashboardState dashboardState,
                      Iterable<DashboardChange> changes)
                      throws DashboardStateStoreException
Update the stored DashboardState in the persistent data store, using the changes passed in.

Parameters:
dashboardState - the DashboardState to update in the persistent data store
changes - the changes to the dashboard that should be applied
Returns:
the actual stored DashboardState so that it can be verified that the state we tried to store is the actual state that is in the store
Throws:
DashboardStateStoreException - thrown if there is a problem when updating the DashboardState in the persistent data store

remove

void remove(DashboardId id)
            throws DashboardStateStoreException
Removes the DashboardState identified by the DashboardId from the persistent data store.

Parameters:
id - unique identifier of the DashboardState to be removed from the persistent data store
Throws:
DashboardStateStoreException - thrown if there is a problem when removing the DashboardState from the persistent data store

findDashboardWithGadget

DashboardState findDashboardWithGadget(GadgetId gadgetId)
                                       throws DashboardNotFoundException
Retrieve the DashboardState for the dashboard containing the gadget whose identifier is gadgetID

Parameters:
gadgetId - the identifier of the gadget
Returns:
the DashboardState object for the dashboard containing the gadget
Throws:
DashboardNotFoundException - thrown if there is a problem retrieving the DashboardState from the persistent store


Copyright © 2014 Atlassian. All Rights Reserved.