MailContentManager
.@ParametersAreNonnullByDefault @Deprecated public class DefaultMailContentManager extends Object implements MailContentManager
ITERATE_ALL
Constructor and Description |
---|
DefaultMailContentManager()
Deprecated.
|
Modifier and Type | Method and Description |
---|---|
int |
findMailTotal(Space space)
Deprecated.
|
ContentEntityObject |
getById(long id)
Deprecated.
|
Mail |
getFirstMailAfter(String spaceKey,
long mailId)
Deprecated.
|
Mail |
getFirstMailBefore(String spaceKey,
long mailId)
Deprecated.
|
List<Mail> |
getMail(Space space,
boolean currentOnly)
Deprecated.
|
Mail |
getMailById(long id)
Deprecated.
Get a mail by its database id.
|
Mail |
getMailByMessageId(String messageId)
Deprecated.
Get a mail by its message-id.
|
List |
getMailsByMessageId(String messageId)
Deprecated.
Get all mails with the matching message-id.
|
ContentEntityObject |
getNextVersion(ContentEntityObject ceo)
Deprecated.
Get the next version of the entity in the sequence of
Versioned . |
ContentEntityObject |
getOtherVersion(ContentEntityObject ceo,
int version)
Deprecated.
|
PageResponse<AbstractPage> |
getPageAndBlogPostsVersionsLastEditedByUser(com.atlassian.sal.api.user.UserKey userKey,
LimitedRequest request)
Deprecated.
Retrieve a page of entities that have been modified by the user, in order of the user's most recent modification.
|
ContentEntityObject |
getPreviousVersion(ContentEntityObject ceo)
Deprecated.
Get the previous version of the entity in the sequence of
Versioned . |
Iterator |
getRecentlyAddedEntities(String spaceKey,
int maxResults)
Deprecated.
Retrieve an iterator of recently added entities, in order of most recent to last.
|
Iterator |
getRecentlyModifiedEntities(String spaceKey,
int maxResults)
Deprecated.
Retrieve an iterator of recently modified entities, in order of most recent to last.
|
Iterator |
getRecentlyModifiedEntitiesForUser(String username)
Deprecated.
Retrieve an iterator of recently modified entities, in order of most recent to last.
|
List |
getRecentlyModifiedForChangeDigest(Date fromDate)
Deprecated.
Retrieves a list of
ContentEntityObject s that have been newly added or modified
since the date specified. |
List |
getSpaceMail(int firstResult,
int maxResults,
String spaceKey)
Deprecated.
|
Iterator |
getSpaceMailIterator(String spaceKey)
Deprecated.
|
Iterator |
getSpaceMailWithAttachmentsIterator(String spaceKey)
Deprecated.
|
List<VersionHistorySummary> |
getVersionHistorySummaries(ContentEntityObject ceo)
Deprecated.
Get a VersionHistorySummary for all previous versions of a ContentEntityObject, starting with the current
content.
|
Map<Long,ContentEntityObject> |
getVersionsLastEditedByUser(Collection<ContentId> contentIds,
com.atlassian.sal.api.user.UserKey userKey)
Deprecated.
Gets the
ContentEntityObject objects relating to the version of the given contentIds that were last
edited by the given user. |
void |
refreshContentEntity(ContentEntityObject obj)
Deprecated.
Refreshes the specified entity (including content) in the Hibernate session to ensure that subsequent retrievals are up-to-date.
|
void |
removeAllMail(Space space)
Deprecated.
|
void |
removeAttachmentsForMail(Mail mail)
Deprecated.
|
void |
removeContentEntity(ContentEntityObject obj)
Deprecated.
Removes given content entity object and all associated domain objects i.e.
|
void |
removeHistoricalVersion(ContentEntityObject historicalVersion)
Deprecated.
Removes a historical ContentEntityObject.
|
void |
removeMail(Mail mail)
Deprecated.
removes mail and its associated attachments
|
void |
revertContentEntityBackToVersion(ContentEntityObject obj,
int version,
String revertComment,
boolean revertTitle)
Deprecated.
Reverts a
ContentEntityObject back to its state at the version specified by version . |
void |
saveContentEntity(ContentEntityObject obj,
ContentEntityObject origObj,
SaveContext saveContext)
Deprecated.
In order to create a history for this object, we need to pass in the modified as well as the original version of the object.
|
void |
saveContentEntity(ContentEntityObject obj,
SaveContext saveContext)
Deprecated.
|
<T extends ContentEntityObject> |
saveNewVersion(T current,
Modification<T> modification)
Deprecated.
Applies the state changes supplied by modification and persists those changes to a new version.
|
<T extends ContentEntityObject> |
saveNewVersion(T current,
Modification<T> modification,
SaveContext saveContext)
Deprecated.
Applies the state changes supplied by modification and persists those changes to a new version.
|
boolean |
spaceHasMail(String spaceKey)
Deprecated.
|
Mail |
storeIncomingMail(Space space,
byte[] rawMessage)
Deprecated.
Create a new mail content object in the given space for the given raw RFC822 message.
|
Mail |
storeIncomingMail(Space space,
javax.mail.internet.MimeMessage mimeMessage)
Deprecated.
Create a new mail content object in the given space for the given mimeMessage.
|
void |
updateContentLinkingTo(SpaceContentEntityObject contentBeingRefactored,
String newSpaceKey,
String newTitle)
Deprecated.
Loops through all the content that currently links to 'contentBeingChanged' and renames all the links.
|
void |
updateOutgoingLinksInContent(SpaceContentEntityObject contentBeingRefactored,
String newSpaceKey)
Deprecated.
Update the links on the page itself.
|
void |
updateSingleContentLinkinTo(ContentEntityObject referringContent,
SpaceContentEntityObject contentBeingRefactored,
String newSpaceKey,
String newTitle)
Deprecated.
Renames all links contained in the 'referringContent' that currently links to 'contentBeingRefactored'.
|
void |
updateSingleContentLinkinTo(ContentEntityObject referringContent,
SpaceContentEntityObject contentBeingRefactored,
String newSpaceKey,
String newTitle,
SaveContext saveContext)
Deprecated.
|
public void refreshContentEntity(ContentEntityObject obj)
ContentEntityManager
refreshContentEntity
in interface ContentEntityManager
obj
- the object to be refreshed in the Hibernate session.public void saveContentEntity(ContentEntityObject obj, @Nullable SaveContext saveContext)
saveContentEntity
in interface ContentEntityManager
obj
- - the ContentEntityObject
to savesaveContext
- - a SaveContext
holding additional parameters for the manager to use when saving.public void saveContentEntity(ContentEntityObject obj, @Nullable ContentEntityObject origObj, @Nullable SaveContext saveContext)
ContentEntityManager
saveContentEntity
in interface ContentEntityManager
saveContext
- - a SaveContext
holding additional parameters for the manager to use when saving.public <T extends ContentEntityObject> void saveNewVersion(T current, Modification<T> modification)
ContentEntityManager
manager.<Page>saveNewVersion(page, new Modification<Page>() { public void modify(Page page) { page.setTitle("foobar"); } });
saveNewVersion
in interface ContentEntityManager
T
- the type content. This ensures that the type of current is the same as the type passed to the modificationcurrent
- the current / latest versionmodification
- an implementation of Modification
which describes the state changes you requirepublic <T extends ContentEntityObject> void saveNewVersion(T current, Modification<T> modification, @Nullable SaveContext saveContext)
ContentEntityManager
manager.<Page>saveNewVersion(page, new Modification<Page>() { public void modify(Page page) { page.setTitle("foobar"); } }, new DefaultSaveContext());
saveNewVersion
in interface ContentEntityManager
T
- the type content. This ensures that the type of current is the same as the type passed to the modificationcurrent
- the current / latest versionmodification
- an implementation of Modification
which describes the state changes you requiresaveContext
- the save context (null if you have no specific requirements - or just use ContentEntityManager.saveNewVersion(ContentEntityObject, Modification)
).public void removeContentEntity(ContentEntityObject obj)
ContentEntityManager
removeContentEntity
in interface ContentEntityManager
public void revertContentEntityBackToVersion(ContentEntityObject obj, int version, @Nullable String revertComment, boolean revertTitle)
ContentEntityManager
Reverts a ContentEntityObject
back to its state at the version specified by version
.
Creates a new latest version that resembles the previous state.
Since Confluence 4.0 most ContentEntityObjects are assumed to be XHTML formatted. So in reverting a ContentEntityObject which
actually has a WIKI BodyType
this will be migrated on the fly to XHTML.
revertContentEntityBackToVersion
in interface ContentEntityManager
obj
- The ContentEntityObject to revertversion
- The version to revert torevertComment
- A comment to be associated with the revertrevertTitle
- If true, the ContentEntityObject title will be reverted to the old state@Nonnull public Iterator getRecentlyAddedEntities(@Nullable String spaceKey, int maxResults)
ContentEntityManager
For performance reasons, it's a VERY bad idea to supply both a space key, and infinite results.
If you supply a space key, this WILL NOT RETURN ANY COMMENTS. There is currently no way around this, you have to retrieve comments separately and splice the results together. Sorry.
getRecentlyAddedEntities
in interface ContentEntityManager
spaceKey
- the space key to look up the entities for. If spaceKey is null, there
is assumed to be no space, and things like user info and space descriptions will
also be returned.maxResults
- the maximum number of entities to return in the iterator. Any number
zero or less (Use the ITERATE_ALL constant) will cause the iterator to go over
every entity.@Nonnull public Iterator getRecentlyModifiedEntities(String spaceKey, int maxResults)
ContentEntityManager
For performance reasons, it's a VERY bad idea to supply both a space key, and infinite results.
getRecentlyModifiedEntities
in interface ContentEntityManager
spaceKey
- the space key to look up the entities for.maxResults
- the maximum number of entities to return in the iterator. Any number
zero or less (Use the ITERATE_ALL constant) will cause the iterator to go over
every entity.@Nonnull public List getRecentlyModifiedForChangeDigest(Date fromDate)
ContentEntityManager
ContentEntityObject
s that have been newly added or modified
since the date specified. This list excludes drafts, space descriptions and mail.getRecentlyModifiedForChangeDigest
in interface ContentEntityManager
fromDate
- content modified after this date will be returnedContentEntityObject
s that have been newly added or modified
since the date specified@Nonnull public PageResponse<AbstractPage> getPageAndBlogPostsVersionsLastEditedByUser(com.atlassian.sal.api.user.UserKey userKey, LimitedRequest request)
ContentEntityManager
getPageAndBlogPostsVersionsLastEditedByUser
in interface ContentEntityManager
userKey
- the key for the user for whom to retrieve the modified contentrequest
- the request@Nonnull public Iterator getRecentlyModifiedEntitiesForUser(String username)
ContentEntityManager
getRecentlyModifiedEntitiesForUser
in interface ContentEntityManager
username
- the user for which to retrieve the modified content@Nullable public ContentEntityObject getById(long id)
getById
in interface ContentEntityManager
public void updateContentLinkingTo(SpaceContentEntityObject contentBeingRefactored, String newSpaceKey, String newTitle)
ContentEntityManager
updateContentLinkingTo
in interface ContentEntityManager
public void updateOutgoingLinksInContent(SpaceContentEntityObject contentBeingRefactored, String newSpaceKey)
ContentEntityManager
updateOutgoingLinksInContent
in interface ContentEntityManager
public void updateSingleContentLinkinTo(ContentEntityObject referringContent, SpaceContentEntityObject contentBeingRefactored, String newSpaceKey, String newTitle)
ContentEntityManager
updateSingleContentLinkinTo
in interface ContentEntityManager
public void updateSingleContentLinkinTo(ContentEntityObject referringContent, SpaceContentEntityObject contentBeingRefactored, String newSpaceKey, String newTitle, @Nullable SaveContext saveContext)
updateSingleContentLinkinTo
in interface ContentEntityManager
@Nullable public ContentEntityObject getPreviousVersion(ContentEntityObject ceo)
ContentEntityManager
Versioned
.
Returns null for ContentEntityObject.DRAFT
s.
getPreviousVersion
in interface ContentEntityManager
@Nullable public ContentEntityObject getNextVersion(ContentEntityObject ceo)
ContentEntityManager
Versioned
.
Returns null for ContentEntityObject.DRAFT
s.
getNextVersion
in interface ContentEntityManager
@Nullable public ContentEntityObject getOtherVersion(ContentEntityObject ceo, int version)
getOtherVersion
in interface ContentEntityManager
@Nonnull public List<VersionHistorySummary> getVersionHistorySummaries(ContentEntityObject ceo)
ContentEntityManager
getVersionHistorySummaries
in interface ContentEntityManager
ceo
- the entity object to return the version history ofpublic Mail getMailById(long id)
MailContentManager
getMailById
in interface MailContentManager
public Mail getMailByMessageId(String messageId)
MailContentManager
getMailByMessageId
in interface MailContentManager
public List getMailsByMessageId(String messageId)
MailContentManager
getMailsByMessageId
in interface MailContentManager
messageId
- the message id of the mails to retrievepublic Mail storeIncomingMail(Space space, javax.mail.internet.MimeMessage mimeMessage)
MailContentManager
storeIncomingMail
in interface MailContentManager
space
- the space to attach the message tomimeMessage
- the message that has been receivedpublic Mail storeIncomingMail(Space space, byte[] rawMessage)
MailContentManager
We use a byte array because RFC822 messages are streams of bytes - character encoding happens after the header is parsed
storeIncomingMail
in interface MailContentManager
space
- the space to attach the message torawMessage
- the message that has been receivedpublic void removeMail(Mail mail)
MailContentManager
removeMail
in interface MailContentManager
mail
- the mail to removepublic void removeAttachmentsForMail(Mail mail)
removeAttachmentsForMail
in interface MailContentManager
public Iterator getSpaceMailIterator(String spaceKey)
getSpaceMailIterator
in interface MailContentManager
public Iterator getSpaceMailWithAttachmentsIterator(String spaceKey)
getSpaceMailWithAttachmentsIterator
in interface MailContentManager
public List getSpaceMail(int firstResult, int maxResults, String spaceKey)
getSpaceMail
in interface MailContentManager
public int findMailTotal(Space space)
findMailTotal
in interface MailContentManager
public List<Mail> getMail(Space space, boolean currentOnly)
getMail
in interface MailContentManager
public boolean spaceHasMail(String spaceKey)
spaceHasMail
in interface MailContentManager
public Mail getFirstMailAfter(String spaceKey, long mailId)
getFirstMailAfter
in interface MailContentManager
public Mail getFirstMailBefore(String spaceKey, long mailId)
getFirstMailBefore
in interface MailContentManager
public void removeAllMail(Space space)
removeAllMail
in interface MailContentManager
public void removeHistoricalVersion(ContentEntityObject historicalVersion)
ContentEntityManager
removeHistoricalVersion
in interface ContentEntityManager
historicalVersion
- a historical entity object to remove@Nonnull public Map<Long,ContentEntityObject> getVersionsLastEditedByUser(Collection<ContentId> contentIds, com.atlassian.sal.api.user.UserKey userKey)
ContentEntityManager
ContentEntityObject
objects relating to the version of the given contentIds that were last
edited by the given user. Only content with a "current" status are returned.getVersionsLastEditedByUser
in interface ContentEntityManager
contentIds
- the ids of the content we're interested in. These *must* be ids of the latest version.userKey
- the userKey of the user that we're interested inContentEntityObject
objects relating to the version of the given contentIds that were last
edited by the given user.Copyright © 2003–2017 Atlassian. All rights reserved.