com.atlassian.jira.portal
Interface PortalPageStore

All Known Implementing Classes:
CachingPortalPageStore, OfBizPortalPageStore

public interface PortalPageStore

This is the store for PortalPage objects

Since:
v3.13

Method Summary
 PortalPage adjustFavouriteCount(SharedEntity portalPage, int incrementValue)
          Updates the favourite count of the PortalPage in the database.
 PortalPage create(PortalPage portalPage)
          Creates a PortalPage in the database
 void delete(Long portalPageId)
          Deletes the PortalPage with the specified portalPageId
 void flush()
          Flushes any caches that may exist
 EnclosedIterable<PortalPage> get(SharedEntityAccessor.RetrievalDescriptor descriptor)
          Get a EnclosedIterable of PortalPages for the specified List of ids.
 EnclosedIterable<PortalPage> getAll()
          Get a EnclosedIterable of all PortalPages in the database.
 Collection<PortalPage> getAllOwnedPortalPages(com.atlassian.crowd.embedded.api.User owner)
          Gets all the PortalPage's owned by the specified User
 PortalPage getPortalPage(Long portalPageId)
          Gets the PortalPage with the specified portalPageId
 PortalPage getPortalPageByOwnerAndName(com.atlassian.crowd.embedded.api.User owner, String portalPageName)
          Gets the specified PortalPage that is owned by the User and has the specified portalPageName
 PortalPage getSystemDefaultPortalPage()
          Goes to the database and fetches the system default dashboard configuration.
 PortalPage update(PortalPage portalPage)
          Updates the PortalPage in the database.
 boolean updatePortalPageOptimisticLock(Long portalPageId, Long currentVersion)
          This method will increment the version of the given portalPage by one.
 

Method Detail

getSystemDefaultPortalPage

PortalPage getSystemDefaultPortalPage()
Goes to the database and fetches the system default dashboard configuration.

Returns:
the system default portal page.

get

EnclosedIterable<PortalPage> get(SharedEntityAccessor.RetrievalDescriptor descriptor)
Get a EnclosedIterable of PortalPages for the specified List of ids.

Parameters:
descriptor - retrieval descriptor
Returns:
CloseableIterable that contains reference to PortalPages with the specified ids.

getAll

EnclosedIterable<PortalPage> getAll()
Get a EnclosedIterable of all PortalPages in the database.

Returns:
CloseableIterable that contains reference to all PortalPages.

getAllOwnedPortalPages

Collection<PortalPage> getAllOwnedPortalPages(com.atlassian.crowd.embedded.api.User owner)
Gets all the PortalPage's owned by the specified User

Parameters:
owner - the user who is the owner of the PortalPage's
Returns:
a Collection of PortalPage objects owner by the User

getPortalPageByOwnerAndName

PortalPage getPortalPageByOwnerAndName(com.atlassian.crowd.embedded.api.User owner,
                                       String portalPageName)
Gets the specified PortalPage that is owned by the User and has the specified portalPageName

Parameters:
owner - the User how is the owner of the PortalPage
portalPageName - the name of the PortalPage
Returns:
a PortalPage object or null if it cant be found

getPortalPage

PortalPage getPortalPage(Long portalPageId)
Gets the PortalPage with the specified portalPageId

Parameters:
portalPageId - the id of the PortalPage to locate
Returns:
a PortalPage or null if it cant be found

create

PortalPage create(PortalPage portalPage)
Creates a PortalPage in the database

Parameters:
portalPage - the PortalPage to create
Returns:
the new PortalPage with its new database id

update

PortalPage update(PortalPage portalPage)
Updates the PortalPage in the database.

Parameters:
portalPage - the PortalPage to update
Returns:
a newly updated PortalPage object

updatePortalPageOptimisticLock

boolean updatePortalPageOptimisticLock(Long portalPageId,
                                       Long currentVersion)
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.

Parameters:
portalPageId - The dashboard to update
currentVersion - The current version for this dashboard
Returns:
true if the update is successful, false otherwise

adjustFavouriteCount

PortalPage adjustFavouriteCount(SharedEntity portalPage,
                                int incrementValue)
Updates the favourite count of the PortalPage in the database.

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.

delete

void delete(Long portalPageId)
Deletes the PortalPage with the specified portalPageId

Parameters:
portalPageId - the id of the PortalPage to delete

flush

void flush()
Flushes any caches that may exist



Copyright © 2002-2012 Atlassian. All Rights Reserved.