com.atlassian.gadgets.dashboard.internal.impl
Class TransactionalDashboardStateStoreImpl

java.lang.Object
  extended by com.atlassian.gadgets.dashboard.internal.impl.TransactionalDashboardStateStoreImpl
All Implemented Interfaces:
DashboardStateStore

public class TransactionalDashboardStateStoreImpl
extends Object
implements DashboardStateStore

A DashboardStateStore implementation that adds a transactional wrapper around an existing DashboardStateStore


Constructor Summary
TransactionalDashboardStateStoreImpl(DashboardStateStore stateStore, com.atlassian.sal.api.transaction.TransactionTemplate txTemplate)
          Constructor.
 
Method Summary
 DashboardState findDashboardWithGadget(GadgetId gadgetId)
          Retrieve the DashboardState for the dashboard containing the gadget whose identifier is gadgetID
 void remove(DashboardId dashboardId)
          Removes the DashboardState identified by the DashboardId from the persistent data store.
 DashboardState retrieve(DashboardId dashboardId)
          Retrieve the DashboardState with the DashboardId from the data store.
 DashboardState update(DashboardState state, Iterable<DashboardChange> changes)
          Update the stored DashboardState in the persistent data store, using the changes passed in.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

TransactionalDashboardStateStoreImpl

public TransactionalDashboardStateStoreImpl(DashboardStateStore stateStore,
                                            com.atlassian.sal.api.transaction.TransactionTemplate txTemplate)
Constructor.

Parameters:
stateStore - the dashboard state store to use
txTemplate - the transaction wrapper for persistence operations
Method Detail

retrieve

public DashboardState retrieve(DashboardId dashboardId)
                        throws DashboardNotFoundException
Description copied from interface: DashboardStateStore
Retrieve the DashboardState with the DashboardId from the data store.

Specified by:
retrieve in interface DashboardStateStore
Parameters:
dashboardId - 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

update

public DashboardState update(DashboardState state,
                             Iterable<DashboardChange> changes)
                      throws DashboardStateStoreException
Description copied from interface: DashboardStateStore
Update the stored DashboardState in the persistent data store, using the changes passed in.

Specified by:
update in interface DashboardStateStore
Parameters:
state - 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

public void remove(DashboardId dashboardId)
            throws DashboardStateStoreException
Description copied from interface: DashboardStateStore
Removes the DashboardState identified by the DashboardId from the persistent data store.

Specified by:
remove in interface DashboardStateStore
Parameters:
dashboardId - 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

public DashboardState findDashboardWithGadget(GadgetId gadgetId)
                                       throws DashboardNotFoundException
Description copied from interface: DashboardStateStore
Retrieve the DashboardState for the dashboard containing the gadget whose identifier is gadgetID

Specified by:
findDashboardWithGadget in interface DashboardStateStore
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 © 2009 Atlassian. All Rights Reserved.