Class CachingExternalGadgetStore

java.lang.Object
com.atlassian.jira.portal.gadgets.CachingExternalGadgetStore
All Implemented Interfaces:
ExternalGadgetStore

public class CachingExternalGadgetStore extends Object implements 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 Details

    • specCache

      public final Map<com.atlassian.gadgets.directory.spi.ExternalGadgetSpecId,com.atlassian.gadgets.directory.spi.ExternalGadgetSpec> specCache
    • uriCache

      public final Set<URI> uriCache
  • Constructor Details

    • CachingExternalGadgetStore

      public CachingExternalGadgetStore(ExternalGadgetStore delegateStore)
  • Method Details

    • onClearCache

      @EventListener public void onClearCache(ClearCacheEvent event)
    • getAllGadgetSpecUris

      public Set<com.atlassian.gadgets.directory.spi.ExternalGadgetSpec> getAllGadgetSpecUris()
      Description copied from interface: ExternalGadgetStore
      Retrieves a set of all external gadgets whitelisted in the directory.
      Specified by:
      getAllGadgetSpecUris in interface ExternalGadgetStore
      Returns:
      a set of all external gadgets whitelisted in the directory.
    • addGadgetSpecUri

      public com.atlassian.gadgets.directory.spi.ExternalGadgetSpec addGadgetSpecUri(URI uri)
      Description copied from interface: ExternalGadgetStore
      Adds the URI specified to the whitelist.
      Specified by:
      addGadgetSpecUri in interface ExternalGadgetStore
      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 interface ExternalGadgetStore
      Parameters:
      id - The id to remove
    • containsSpecUri

      public boolean containsSpecUri(URI uri)
      Description copied from interface: ExternalGadgetStore
      Checks if the specified URI is already contained in the store
      Specified by:
      containsSpecUri in interface ExternalGadgetStore
      Parameters:
      uri - the URI to check for
      Returns:
      true if the URI already exists in the store