Class SessionDraftDao
- java.lang.Object
-
- com.atlassian.confluence.pages.persistence.dao.SessionDraftDao
-
-
Constructor Summary
Constructors Constructor Description SessionDraftDao(javax.servlet.http.HttpSession session)
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description int
countDrafts(String creatorName)
List<Draft>
findAll()
Returns all drafts stored in the data store.List<Draft>
findByCreatorName(String creatorName)
Returns the drafts stored against the given username.Draft
getDraft(long draftId)
Returns the draft with the given ID, or null if no draft is found with that ID.Draft
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
remove(Draft draft)
Removes a draft based on its page ID, owner and type.void
saveOrUpdate(Draft draft)
Saves the draft.
-
-
-
Method Detail
-
saveOrUpdate
public void saveOrUpdate(Draft draft)
Description copied from interface:DraftDao
Saves the draft.- Specified by:
saveOrUpdate
in interfaceDraftDao
-
getDraft
public Draft getDraft(String pageId, ConfluenceUser owner, String type, String spaceKey)
Description copied from interface:DraftDao
Finds and returns a draft object with all the specified properties or null if none is found.- Specified by:
getDraft
in 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
public Draft getDraft(long draftId)
Description copied from interface:DraftDao
Returns the draft with the given ID, or null if no draft is found with that ID.
-
remove
public void remove(Draft draft)
Description copied from interface:DraftDao
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
public List<Draft> findByCreatorName(String creatorName)
Description copied from interface:DraftDao
Returns the drafts stored against the given username.- Specified by:
findByCreatorName
in interfaceDraftDao
-
findAll
public List<Draft> findAll()
Description copied from interface:DraftDao
Returns all drafts stored in the data store.
-
countDrafts
public int countDrafts(String creatorName)
- Specified by:
countDrafts
in interfaceDraftDao
- Returns:
- count of number of drafts for this daos owner
-
-