|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object com.atlassian.jira.portal.CachingPortletConfigurationStore
public class CachingPortletConfigurationStore
Caching store for Portlet Configurations. The cache stores a id -> PortletConfigurationStore and a portalPage.id -> id mapping.
This class is not completely thread safe in that it is possible for the cache and the database to become unsynchronized.
Constructor Summary | |
---|---|
CachingPortletConfigurationStore(PortletConfigurationStore delegateStore,
com.atlassian.event.api.EventPublisher eventPublisher)
|
Method Summary | |
---|---|
PortletConfiguration |
addGadget(Long pageId,
Long portletConfigurationId,
Integer column,
Integer row,
URI gadgetXml,
com.atlassian.gadgets.dashboard.Color color,
Map<String,String> userPreferences)
Creates and adds a new PortletConfiguration to given PortalPage. |
PortletConfiguration |
addLegacyPortlet(Long pageId,
Long portletConfigurationId,
Integer column,
Integer row,
URI gadgetXml,
com.atlassian.gadgets.dashboard.Color color,
Map<String,String> userPreferences,
String portletKey)
Creates and adds a new PortletConfiguration to given PortalPage. |
void |
delete(PortletConfiguration pc)
Deletes the given PortletConfiguration . |
void |
flush()
Flush the cache by removing all entries. |
EnclosedIterable<PortletConfiguration> |
getAllPortletConfigurations()
This is a non-caching call. |
List<PortletConfiguration> |
getByPortalPage(Long portalPageId)
Get all PortletConfiguration objects for a given PortalPage id. |
PortletConfiguration |
getByPortletId(Long portletId)
Gall a PortletConfiguration by its id. |
void |
onClearCache(ClearCacheEvent event)
|
void |
start()
This method wil be called after the plugin system is fully initialised and all components added to the dependency injection framework. |
void |
store(PortletConfiguration pc)
Saves the given PortletConfiguration . |
void |
updateGadgetColor(Long gadgetId,
com.atlassian.gadgets.dashboard.Color color)
Given a gadget, this method will update the color value for this gadget. |
void |
updateGadgetPosition(Long gadgetId,
int row,
int column,
Long dashboardId)
Given a gadget, this method will update it's row, column and parent dashboard id. |
void |
updateUserPrefs(Long gadgetId,
Map<String,String> userPrefs)
Given a gadget, this method updates all userprefs for this gadget. |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Constructor Detail |
---|
public CachingPortletConfigurationStore(PortletConfigurationStore delegateStore, com.atlassian.event.api.EventPublisher eventPublisher)
Method Detail |
---|
public void start() throws Exception
Startable
start
in interface Startable
Exception
- Allows implementations to throw an Exception.@EventListener public void onClearCache(ClearCacheEvent event)
public List<PortletConfiguration> getByPortalPage(Long portalPageId)
PortletConfigurationStore
PortletConfiguration
objects for a given PortalPage
id.
getByPortalPage
in interface PortletConfigurationStore
portalPageId
- The id of the page to retreive all configurations for.
public PortletConfiguration getByPortletId(Long portletId)
PortletConfigurationStore
PortletConfiguration
by its id.
getByPortletId
in interface PortletConfigurationStore
portletId
- The id of the portlet configuration
public void delete(PortletConfiguration pc)
PortletConfigurationStore
PortletConfiguration
.
delete
in interface PortletConfigurationStore
pc
- The PortletConfiguration to delete.public void updateGadgetPosition(Long gadgetId, int row, int column, Long dashboardId)
PortletConfigurationStore
updateGadgetPosition
in interface PortletConfigurationStore
gadgetId
- The id of the gadget being updatedrow
- The new row value for this gadgetcolumn
- The new column value for this gadgetdashboardId
- The new parent dashboard id value for this gadgetpublic void updateGadgetColor(Long gadgetId, com.atlassian.gadgets.dashboard.Color color)
PortletConfigurationStore
updateGadgetColor
in interface PortletConfigurationStore
gadgetId
- The id of the gadget being updatedcolor
- The new color value for this gadgetpublic void updateUserPrefs(Long gadgetId, Map<String,String> userPrefs)
PortletConfigurationStore
updateUserPrefs
in interface PortletConfigurationStore
gadgetId
- The id of the gadget being updateduserPrefs
- The new userprefs to set for this gadget.public void store(PortletConfiguration pc)
PortletConfigurationStore
PortletConfiguration
.
store
in interface PortletConfigurationStore
pc
- The PortletConfiguration to save.public PortletConfiguration addGadget(Long pageId, Long portletConfigurationId, Integer column, Integer row, URI gadgetXml, com.atlassian.gadgets.dashboard.Color color, Map<String,String> userPreferences)
PortletConfigurationStore
PortletConfiguration
to given PortalPage. This should
be used to add a gadget.
addGadget
in interface PortletConfigurationStore
pageId
- The id of the page to add the configuration to.portletConfigurationId
- The id to use for adding the gadget. This will correspond to JiraGadgetStateFactory.createGadgetState(java.net.URI)
. May be null for a generated
id.column
- The column position of the portlet.row
- The row position of the portletgadgetXml
- A URI specifying the location of the gadget XML. May be null if this is a legacy portlet.color
- The chrome color for the gadget.userPreferences
- A map of key -> value user preference pairs used to store gadget configuration.
public PortletConfiguration addLegacyPortlet(Long pageId, Long portletConfigurationId, Integer column, Integer row, URI gadgetXml, com.atlassian.gadgets.dashboard.Color color, Map<String,String> userPreferences, String portletKey)
PortletConfigurationStore
PortletConfiguration
to given PortalPage. This should
be used to add a legacy gadget only!
addLegacyPortlet
in interface PortletConfigurationStore
pageId
- The id of the page to add the configuration to.portletConfigurationId
- The id to use for adding the gadget. This will correspond to JiraGadgetStateFactory.createGadgetState(java.net.URI)
. May be null for a generated
id.column
- The column position of the portlet.row
- The row position of the portletgadgetXml
- A URI specifying the location of the gadget XML. May be null if this is a legacy portlet.color
- The chrome color for the gadget.userPreferences
- A map of key -> value user preference pairs used to store gadget configuration.portletKey
- The portletKey of the old portlet.
public void flush()
flush
in interface FlushablePortletConfigurationStore
public EnclosedIterable<PortletConfiguration> getAllPortletConfigurations()
getAllPortletConfigurations
in interface PortletConfigurationStore
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |