Class CachingExternalGadgetStore
java.lang.Object
com.atlassian.jira.portal.gadgets.CachingExternalGadgetStore
- All Implemented Interfaces:
ExternalGadgetStore
Eagerly caching implementation on the external Gadget store. The contains() method needs to be especially
performant, since every gadget will be checked when displaying a dashboard.
- Since:
- v4.0
-
Field Summary
Fields -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptioncom.atlassian.gadgets.directory.spi.ExternalGadgetSpec
addGadgetSpecUri
(URI uri) Adds the URI specified to the whitelist.boolean
containsSpecUri
(URI uri) Checks if the specified URI is already contained in the storeSet<com.atlassian.gadgets.directory.spi.ExternalGadgetSpec>
Retrieves a set of all external gadgets whitelisted in the directory.void
onClearCache
(ClearCacheEvent event) void
removeGadgetSpecUri
(com.atlassian.gadgets.directory.spi.ExternalGadgetSpecId id) Removes the URI specified from the whitelist.
-
Field Details
-
specCache
public final Map<com.atlassian.gadgets.directory.spi.ExternalGadgetSpecId,com.atlassian.gadgets.directory.spi.ExternalGadgetSpec> specCache -
uriCache
-
-
Constructor Details
-
CachingExternalGadgetStore
-
-
Method Details
-
onClearCache
-
getAllGadgetSpecUris
Description copied from interface:ExternalGadgetStore
Retrieves a set of all external gadgets whitelisted in the directory.- Specified by:
getAllGadgetSpecUris
in interfaceExternalGadgetStore
- Returns:
- a set of all external gadgets whitelisted in the directory.
-
addGadgetSpecUri
Description copied from interface:ExternalGadgetStore
Adds the URI specified to the whitelist.- Specified by:
addGadgetSpecUri
in interfaceExternalGadgetStore
- Parameters:
uri
- The gadget URI to add- Returns:
- The newly created ExternalGAdgetSpec
-
removeGadgetSpecUri
public void removeGadgetSpecUri(com.atlassian.gadgets.directory.spi.ExternalGadgetSpecId id) Description copied from interface:ExternalGadgetStore
Removes the URI specified from the whitelist.- Specified by:
removeGadgetSpecUri
in interfaceExternalGadgetStore
- Parameters:
id
- The id to remove
-
containsSpecUri
Description copied from interface:ExternalGadgetStore
Checks if the specified URI is already contained in the store- Specified by:
containsSpecUri
in interfaceExternalGadgetStore
- Parameters:
uri
- the URI to check for- Returns:
- true if the URI already exists in the store
-