Class OfBizPortalPageStore

java.lang.Object
com.atlassian.jira.portal.OfBizPortalPageStore
All Implemented Interfaces:
PortalPageStore

public class OfBizPortalPageStore extends Object implements PortalPageStore
The PortalPageStore implementation that uses OfBiz
Since:
v3.13
  • Constructor Details

  • Method Details

    • get

      Description copied from interface: PortalPageStore
      Get a EnclosedIterable of PortalPages for the specified List of ids.
      Specified by:
      get in interface PortalPageStore
      Parameters:
      descriptor - retrieval descriptor
      Returns:
      CloseableIterable that contains reference to PortalPages with the specified ids.
    • getAll

      public EnclosedIterable<PortalPage> getAll()
      Description copied from interface: PortalPageStore
      Get a EnclosedIterable of all PortalPages in the database.
      Specified by:
      getAll in interface PortalPageStore
      Returns:
      CloseableIterable that contains reference to all PortalPages.
    • getAllOwnedPortalPages

      public Collection<PortalPage> getAllOwnedPortalPages(ApplicationUser owner)
      Description copied from interface: PortalPageStore
      Gets all the PortalPage's owned by the specified User
      Specified by:
      getAllOwnedPortalPages in interface PortalPageStore
      Parameters:
      owner - the User who is the owner of the PortalPages
      Returns:
      a NON NULL Collection of PortalPage objects
    • getAllOwnedPortalPages

      public Collection<PortalPage> getAllOwnedPortalPages(String userKey)
      Description copied from interface: PortalPageStore
      Gets all the PortalPage's owned by the specified User
      Specified by:
      getAllOwnedPortalPages in interface PortalPageStore
      Parameters:
      userKey - The key of the user who is the owner of the PortalPage's
      Returns:
      a Collection of PortalPage objects owner by the User
    • getPortalPageByOwnerAndName

      public PortalPage getPortalPageByOwnerAndName(ApplicationUser owner, String name)
      Description copied from interface: PortalPageStore
      Gets the specified PortalPage that is owned by the User and has the specified portalPageName
      Specified by:
      getPortalPageByOwnerAndName in interface PortalPageStore
      Parameters:
      owner - the User how is the owner of the PortalPage
      name - the name of the PortalPage
      Returns:
      a PortalPage object or null if it cant be found
    • getPortalPage

      public PortalPage getPortalPage(Long portalPageId)
      Description copied from interface: PortalPageStore
      Gets the PortalPage with the specified portalPageId
      Specified by:
      getPortalPage in interface PortalPageStore
      Parameters:
      portalPageId - the id of the PortalPage to locate
      Returns:
      a PortalPage or null if it cant be found
    • update

      public PortalPage update(PortalPage portalPage)
      Description copied from interface: PortalPageStore
      Updates the PortalPage in the database.
      Specified by:
      update in interface PortalPageStore
      Parameters:
      portalPage - the PortalPage to update
      Returns:
      a newly updated PortalPage object
    • adjustFavouriteCount

      public PortalPage adjustFavouriteCount(SharedEntity portalPage, int incrementValue)
      Description copied from interface: PortalPageStore
      Updates the favourite count of the PortalPage in the database.
      Specified by:
      adjustFavouriteCount in interface PortalPageStore
      Parameters:
      portalPage - the portal page to change.
      incrementValue - the value to increase the favourite count by. Can be a number < 0 to decrease the favourite count.
      Returns:
      a newly updated PortalPage object.
    • create

      public PortalPage create(PortalPage portalPage)
      Description copied from interface: PortalPageStore
      Creates a PortalPage in the database
      Specified by:
      create in interface PortalPageStore
      Parameters:
      portalPage - the PortalPage to create
      Returns:
      the new PortalPage with its new database id
    • delete

      public void delete(Long portalPageId)
      Description copied from interface: PortalPageStore
      Deletes the PortalPage with the specified portalPageId
      Specified by:
      delete in interface PortalPageStore
      Parameters:
      portalPageId - the id of the PortalPage to delete
    • getSystemDefaultPortalPage

      public PortalPage getSystemDefaultPortalPage()
      Description copied from interface: PortalPageStore
      Goes to the database and fetches the system default dashboard configuration.
      Specified by:
      getSystemDefaultPortalPage in interface PortalPageStore
      Returns:
      the system default portal page.
    • updatePortalPageOptimisticLock

      public boolean updatePortalPageOptimisticLock(Long portalPageId, Long currentVersion)
      Description copied from interface: PortalPageStore
      This method will increment the version of the given portalPage by one. When doing this, it will check that the version currently equals what was passed in. If the update is successful, this method returns true. False otherwise

      In JIRA since we don't have transactions, this method should be called inside a pessimistic lock (potentially striped by portalPageId) and all update operations should follow while holding this same lock.

      Specified by:
      updatePortalPageOptimisticLock in interface PortalPageStore
      Parameters:
      portalPageId - The dashboard to update
      currentVersion - The current version for this dashboard
      Returns:
      true if the update is successful, false otherwise
    • flush

      public void flush()
      Description copied from interface: PortalPageStore
      Flushes any caches that may exist
      Specified by:
      flush in interface PortalPageStore