Interface DraftDao
- All Known Implementing Classes:
HibernateDraftDao
,SessionDraftDao
public interface DraftDao
Stores Confluence drafts in a data store.
-
Method Summary
Modifier and TypeMethodDescriptionint
countDrafts
(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.void
Removes a draft based on its page ID, owner and type.void
saveOrUpdate
(Draft draft) Saves the draft.
-
Method Details
-
saveOrUpdate
Saves the draft.- Throws:
IllegalArgumentException
- if the draft has no page ID, owner or type.
-
getDraft
Finds and returns a draft object with all the specified properties or null if none is found.- 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
- Since:
- 5.2
-
getDraft
Returns the draft with the given ID, or null if no draft is found with that ID. -
remove
Removes a draft based on its page ID, owner and type. Does nothing if such a draft is not found in the data store. -
findByCreatorName
Returns the drafts stored against the given username. -
findAll
Returns all drafts stored in the data store. -
countDrafts
- Returns:
- count of number of drafts for this daos owner
-