Class SessionDraftDao
java.lang.Object
com.atlassian.confluence.pages.persistence.dao.SessionDraftDao
- All Implemented Interfaces:
DraftDao
Stores drafts in the session, primarily for anonymous users.
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionintcountDrafts(String creatorName) findAll()Returns all drafts stored in the data store.findByCreatorName(String creatorName) Returns the drafts stored against the given username.getDraft(long draftId) Returns the draft with the given ID, or null if no draft is found with that ID.getDraft(String pageId, ConfluenceUser owner, String type, String spaceKey) Finds and returns a draft object with all the specified properties or null if none is found.voidRemoves a draft based on its page ID, owner and type.voidsaveOrUpdate(Draft draft) Saves the draft.
-
Constructor Details
-
SessionDraftDao
public SessionDraftDao(javax.servlet.http.HttpSession session)
-
-
Method Details
-
saveOrUpdate
Description copied from interface:DraftDaoSaves the draft.- Specified by:
saveOrUpdatein interfaceDraftDao
-
getDraft
Description copied from interface:DraftDaoFinds and returns a draft object with all the specified properties or null if none is found.- Specified by:
getDraftin interfaceDraftDao- Parameters:
pageId- the id of the page which this draft is associated withowner- the owner of the drafttype- the type of draft, which is usually the result of callingContentEntityObject.getType()spaceKey- space key, if relevant for the draft. This is used to enable NEW page drafts across multiple spaces- Returns:
- a draft object with all the specified properties or null if no valid draft could be found
-
getDraft
Description copied from interface:DraftDaoReturns the draft with the given ID, or null if no draft is found with that ID. -
remove
Description copied from interface:DraftDaoRemoves a draft based on its page ID, owner and type. Does nothing if such a draft is not found in the data store. -
findByCreatorName
Description copied from interface:DraftDaoReturns the drafts stored against the given username.- Specified by:
findByCreatorNamein interfaceDraftDao
-
findAll
Description copied from interface:DraftDaoReturns all drafts stored in the data store. -
countDrafts
- Specified by:
countDraftsin interfaceDraftDao- Returns:
- count of number of drafts for this daos owner
-