com.atlassian.gadgets.dashboard.spi
Interface DashboardStateStore


public interface DashboardStateStore

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

Since:
2.0

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

Method Detail

retrieve

com.atlassian.gadgets.dashboard.DashboardState retrieve(com.atlassian.gadgets.dashboard.DashboardId id)
                                                        throws com.atlassian.gadgets.dashboard.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:
com.atlassian.gadgets.dashboard.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

com.atlassian.gadgets.dashboard.DashboardState update(com.atlassian.gadgets.dashboard.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(com.atlassian.gadgets.dashboard.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

com.atlassian.gadgets.dashboard.DashboardState findDashboardWithGadget(com.atlassian.gadgets.GadgetId gadgetId)
                                                                       throws com.atlassian.gadgets.dashboard.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:
com.atlassian.gadgets.dashboard.DashboardNotFoundException - thrown if there is a problem retrieving the DashboardState from the persistent store


Copyright © 2011 Atlassian. All Rights Reserved.